Home | Trees | Indices | Help |
|
---|
|
object --+ | Class
These objects refer to the table objects in the InterMine ORM layer.
>>> service = Service("http://www.flymine.org/query/service") >>> model = service.model >>> >>> if "Gene" in model.classes: ... gene_cd = model.get_class("Gene") ... print "Gene has", len(gene_cd.fields), "fields" ... for field in gene_cd.fields: ... print " - ", field.name
Each class can have attributes (columns) of various types, and can have references to other classes (tables), on either a one-to-one (references) or one-to-many (collections) basis
Classes should not be instantiated by hand, but rather used as part of the model they belong to.
|
|||
|
|||
|
|||
subclass of intermine.model.Field |
|
||
boolean |
|
||
Inherited from |
|
|||
list(Field) |
fields The fields are returned sorted by name. |
||
list(Attribute) | attributes | ||
list(Reference) | references | ||
list(Collection) | collections | ||
Inherited from |
|
Constructor - Creates a new Class descriptor>>> cd = intermine.model.Class("Gene", ["SequenceFeature"]) <intermine.model.Class: Gene> This constructor is called when deserialising the model - you should have no need to create Classes by hand
|
repr(x)
|
Get a field by nameThe standard way of retrieving a field
|
Check if self is, or inherits from otherThis method validates statements about inheritance. Returns true if the "other" is, or is within the ancestry of, this class Other can be passed as a name (str), or as the class object itself
|
|
fieldsThe fields of this classThe fields are returned sorted by name. Fields includes all Attributes, References and Collections
|
attributesThe fields of this class which contain data
|
referencesfields which reference other objects
|
collectionsfields which reference many other objects
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Aug 3 15:35:51 2011 | http://epydoc.sourceforge.net |