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

Type OneToOne

               object --+    
                        |    
AssociationReferenceProxy --+
                            |
                           OneToOne

Known Subclasses:
BiDirOneToOne

Class for uni-directional one-to-one association descriptors.

See Also: bazaar.assoc.AssociationReferenceProxy bazaar.assoc.BiDirOneToOne

Method Summary
  __get__(self, obj, cls)
Descriptor interface method to retrieve reference of referenced object for application object.
  __set__(self, obj, value)
Descriptor interface method to set application object's attribute and foreign key values.
  saveForeignKey(self, obj, vkey)
Save referenced object's primary key value.
    Inherited from AssociationReferenceProxy
  __init__(self, col, ref_buf)
Create association reference proxy.
  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 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

__get__(self, obj, cls)

Descriptor interface method to retrieve reference of referenced object for application object.
Parameters:
obj - Application object.
cls - Application class.
Returns:
Referenced object when obj is not null, otherwise descriptor object.

__set__(self, obj, value)

Descriptor interface method to set application object's attribute and foreign key values.

This method is optimized for uni-directional one-to-one association.
Parameters:
obj - Application object.
value - Referenced object.

saveForeignKey(self, obj, vkey)

Save referenced object's primary key value.

Application object's foreign key value is set to referenced object's primary key value.
Parameters:
obj - Application object.
vkey - Referenced object primary key value.
Overrides:
bazaar.assoc.AssociationReferenceProxy.saveForeignKey

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