Package bazaar :: Module assoc :: Class OneToMany
[show private | hide private]
[frames | no frames]

Type OneToMany

               object --+            
                        |            
AssociationReferenceProxy --+        
                            |        
                         List --+    
                                |    
                        BiDirList --+
                                    |
                                   OneToMany


One-to-many association descriptor.

One-to-many association defined on "one" side is always bi-directional relationship.
Method Summary
  __init__(self, col)
Create descriptor for one-to-many associations.
  addReferencedObjects(self, pairs)
Add referenced objects into database.
  append(self, obj, value)
Append referenced object to association and integrate association data.
  delReferencedObjects(self, pairs)
Delete referenced objects from database.
  getAllKeys(self)
Return tuple of application object's and referenced object's primary key values.
  reloadData(self, now)
Request reloading association relational data.
  updateableAscData(self, obj, value)
Return pair of application object and referenced object.
  updateReferencedObjects(self, pairs)
Update referenced objects in database.
    Inherited from BiDirList
  integrateRemove(self, obj, value)
Integrate association data when referenced object is removed from association.
  integrateSave(self, obj, value)
Integrate association data when referenced object is appended to association.
  remove(self, obj, value)
Remove referenced object from association and integrate association data.
    Inherited from List
  __get__(self, obj, cls)
Descriptor method to get iterator of referenced objects.
  __set__(self, obj, value)
Assigning list of referenced objects is not implemented yet.
  addAscData(self, pairs)
Add pair of application object's and referenced object's primary key values into database.
  appendKey(self, okey, vkey)
Append referenced object relational data to association data.
  contains(self, obj, value)
Check if object is referenced by application object.
  delAscData(self, pairs)
Remove pair of application object's and referenced object's primary key values from database.
  iterObjects(self, obj)
Return iterator of all referenced objects by application object.
  justRemove(self, obj, value)
Remove referenced object from association.
  len(self, obj)
Return amount of all referenced objects by application object.
  loadData(self)
Load association data from database.
  saveForeignKey(self, obj, vkey)
Save referenced object's primary key value.
  update(self, obj)
Update in database relational data of association of given application object.
    Inherited from AssociationReferenceProxy
  save(self, obj, value)
Assign referenced object.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
    Inherited from List
  appended: Sets of referenced objects appended to association.
  cache: Association data cache - sets of referenced objects's primary key values per application object.
  reload: If true, then association data will be loaded from database.
  removed: Sets of referenced objects removed from association.
    Inherited from AssociationReferenceProxy
  association: Referenced class' association object of bi-directional association.
  broker: Broker of application class.
  col: Application object's class attribute.
  vbroker: Broker of referenced application objects' class.

Method Details

__init__(self, col)
(Constructor)

Create descriptor for one-to-many associations.
Parameters:
col - Referenced application object's class column.
Overrides:
bazaar.assoc.List.__init__

See Also: bazaar.assoc.AssociationReferenceProxy.__init__

addReferencedObjects(self, pairs)

Add referenced objects into database.

The method is used as addAscData method with one-to-many associations when updating relationship.

See Also: delReferencedObjects updateReferencedObjects update

append(self, obj, value)

Append referenced object to association and integrate association data.
Parameters:
obj - Application object.
value - Referenced object.
Overrides:
bazaar.assoc.BiDirList.append

delReferencedObjects(self, pairs)

Delete referenced objects from database.

The method is used as delAscData method with one-to-many associations when updating relationship.

See Also: addReferencedObjects updateReferencedObjects update

getAllKeys(self)

Return tuple of application object's and referenced object's primary key values.

Referenced object is taken from referenced class broker.
Overrides:
bazaar.assoc.List.getAllKeys

reloadData(self, now=False)

Request reloading association relational data. Referenced objects are reloaded, too.

Association data are removed from memory. If now is set to true, then relationship data are loaded from database immediately.
Parameters:
now - Reload relationship data immediately.
Overrides:
bazaar.assoc.List.reloadData

updateableAscData(self, obj, value)

Return pair of application object and referenced object.

The data will be used to update association in database.
Overrides:
bazaar.assoc.List.updateableAscData

See Also: update

updateReferencedObjects(self, pairs)

Update referenced objects in database.

The method is used as addAscData and as delAscData with one-to-many associations when updating relationship.

See Also: addReferencedObjects delReferencedObjects update


Generated by Epydoc 2.1 on Tue May 10 18:27:29 2005 http://epydoc.sf.net