I'll see if I can answer this (Rasmus would probably do it better).
(1) If you have a model object, by which I think you mean an API object
inside Analysis (e.g. the project, or a spectrumWindow), then you can get
the metamodel class (so a metaobject) associated with the (API) object by
doing
c = object.metaclass
and that contains lots of useful information. For example, c.keyNames
gives the names of the keys relative to the parent. To go from a name to
the actual metaobject you do c.elementDict[name]. This will be either a
MetaAttribute or a MetaRole.
(2) Basically you have to know which ones are API ones and the rest
therefore are not! (Well, most of the API ones are public in the sense
that they mirror exactly what the API provides. But there are one or two
oddities on top, e.g. _preDelete.)
(3) metaobject.documentation gives some documentation. So say you have a
ccp.api.Nmr.Experiment object, e. And you want to find the documentation
for the attribute numDim of e. You can do
e.metaclass.elementDict['numDim'].documentation
Hope this makes sense.
Wayne
On Fri, 26 May 2006, Gary S. Thompson wrote:
> Dear All
> some technical but in some cases useful questions
>
> 1. I have a model object how do I determine it's path from the root
> object programmatically including the keys I must lookup to find it
> 2. if I have an object from the hierachy of objects under the project
> how can I tell which fields of the object are provided by the datamodel
> and which are part of the standard python machinary
> 3. if I have a model object how can i get to the documentation of it's
> fields functions and and classes
>
> is this the realm of meta models
>
> regards
> gary
>
>
> --
> -------------------------------------------------------------------
> Dr Gary Thompson
> Astbury Centre for Structural Molecular Biology,
> University of Leeds, Astbury Building,
> Leeds, LS2 9JT, West-Yorkshire, UK Tel. +44-113-3433024
> email: [log in to unmask] Fax +44-113-2331407
> -------------------------------------------------------------------
>
|