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

Type AssociationReferenceProxy

object --+
         |
        AssociationReferenceProxy

Known Subclasses:
List, OneToOne

Association reference proxy class for application objects.

Reference proxy allows to get (upon foreign key value of object's column) and set (upon primary key value of referenced object) reference to other application object (referenced object).

There should be one reference proxy object per association between application classes.

It is allowed to set reference to:

When referenced object has no primary key, then reference proxy buffers the object as value with reference buffer.

Application class attribute col defines parameters of association.

See Also: bazaar.cache.ReferenceBuffer bazaar.cache.ListReferenceBuffer bazaar.conf.Persistence bazaar.conf.Column

Method Summary
  __init__(self, col, ref_buf)
Create association reference proxy.
  save(self, obj, value)
Assign referenced object.
  saveForeignKey(self, obj, vkey)
Abstract method to save referenced object's primary key value.
    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
  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, ref_buf=None)
(Constructor)

Create association reference proxy.

Brokers are not initialized with the constructor. Instead, they are set when Bazaar ORM layer is started up.
Parameters:
col - Application object's class attribute.
Overrides:
__builtin__.object.__init__

See Also: bazaar.core.Bazaar.__init__ bazaar.conf.Persistence bazaar.conf.Column

save(self, obj, value)

Assign referenced object.

If primary key value of referenced object is not defined, then it is stored in reference buffer, otherwise it's set with saveForeignKey method.
Parameters:
obj - Application object.
value - Referenced object.

See Also: saveForeignKey bazaar.cache.ReferenceBuffer bazaar.cache.ListReferenceBuffer

saveForeignKey(self, obj, vkey)

Abstract method to save referenced object's primary key value.
Parameters:
obj - Application object.
vkey - Referenced object primary key value.

See Also: bazaar.assoc.List bazaar.assoc.OneToOne


Instance Variable Details

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.

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