| Home | Trees | Index | Help |
|
|---|
|
|
object --+
|
model.Model --+
|
Family
Family
A specializedModel which has kids,
kid_slots, and a number of convenience functions for
traversing the parent/child graph.
|
|||
|
Inherited from |
|||
|
|||
|
__init__(self,
*args,
**kwargs)
__init__(self, [<attrname>=<value, rule or dict>], ...) -> None |
|||
|
_kid_instance(self,
klass=None)
Creates a new instance of a Cell based on the passed class (in klass) and the overrides defined in
kid_slots.
|
|||
|
make_kid(self,
klass)
Adds a new instance of a Cell based on the passed class (in klass) and the overrides defined in
kid_slots into the kids list
|
|||
|
_add_kid(self,
kid)
Inserts the kid into this Family's kids list
|
|||
|
position(self)
Returns this instance's position in the enclosing Family's kids list.
|
|||
|
previous_sib(self)
Returns the Model previous to this Model in the enclosing Family's kids list
|
|||
|
next_sib(self)
Returns the Model subsequent to this Model in the enclosing Family's kids list
|
|||
|
grandparent(self)
Returns enclosing Family instance's enclosing Family instance, or None if no such object exists. |
|||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
| _noncells | |||
|
Inherited from Inherited from |
|||
|
|||
| kids | A list of Models which are guaranteed to have the attribute
overrides defined in kid_slots |
||
| kid_slots | An override definition for the Cells inserted into the
kids list. |
||
|
Inherited from |
|||
|
|||
__init__(self, [<attrname>=<value, rule or dict>], ...) -> None Initialize a Model with optional overrides. By passing a parameter with the same name as a cell attribute, you may override that cell attribute. For example:>>> class A(cells.Model): ... x = cells.makecell(value=1) ... >>> a1 = A() >>> a1.x 1 >>> a2 = A(x="blah") >>> a2.x 'blah'This override can be arbitrarily complex; for instance, you can make a RuleCell into a ValueCell, change a attribute's celltype ... In short, anything you can do at Model defintion time you can alter at instantiation time: >>> class B(cells.Model): ... x = cells.makecell(rule=lambda s,p: 3 * s.y) ... y = cells.makecell(value=2) ... >>> b = B() >>> b.x 6 >>> b.y = 1 >>> b.x 3 >>> b = B(y=10) >>> b.x 30 >>> b.y 10 >>> b = B(x={'celltype': cells.RuleThenInputCell}) >>> b.x 6 >>> b.y 2 >>> b.x = 5 >>> b.x 5 >>> b.y = 1 >>> b.x 5
|
klass) and the overrides defined in
kid_slots.
|
klass) and the overrides defined in kid_slots
into the kids list
|
kids list
|
kids list. Returns -1 if there is no enclosing Family.
|
kids list
|
kids list
|
|
|
|||
_noncells
|
|
|||
kidsA list of Models which are guaranteed to have the attribute overrides defined inkid_slots
|
kid_slotsAn override definition for the Cells inserted into thekids list. The attributes overridden are every attribute
defined in the class in kid_slots minus the attributes
defined in every Model.
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 3.0alpha2 on Sun Aug 20 15:38:10 2006 | http://epydoc.sf.net |