Package bazaar :: Module conf :: Class Persistence
[show private | hide private]
[frames | no frames]

Type Persistence

object --+    
         |    
      type --+
             |
            Persistence


Application class metaclass.

Programmer defines application classes with the metaclass. The class is assigned to the database relation. Class name is used as relation name, by default.
Method Summary
  __new__(self, name, bases, data, relation, sequencer, modname)
Create application class. (Static method)
  addColumn(self, attr, col, vcls, link, vcol, vattr, update)
Add attribute description to persistent application class.
  getColumns(self)
Return list of all defined columns including inherited.
    Inherited from type
  __call__(x, ...)
x.__call__(...) <==> x(...)
  __cmp__(x, y)
x.__cmp__(y) <==> cmp(x,y)
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
list of immediate subclasses __subclasses__()
__subclasses__() -> list of immediate subclasses
list mro()
return a type's method resolution order
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
  cache: Object cache class.
  columns: List of application class attribute descriptions.
  defaults: Default values for class attributes.
  relation: Database relation name.
  sequencer: Name of primary key values generator sequencer.

Class Variable Summary
    Inherited from type
tuple __bases__ = (<type 'object'>,)
int __basicsize__ = 420                                                                   
int __dictoffset__ = 132                                                                   
int __flags__ = 21995                                                                 
int __itemsize__ = 20                                                                    
tuple __mro__ = (<type 'type'>, <type 'object'>)
str __name__ = 'type'
int __weakrefoffset__ = 184                                                                   

Instance Method Details

addColumn(self, attr, col=None, vcls=None, link=None, vcol=None, vattr=None, update=True)

Add attribute description to persistent application class.

This way the application class attributes and relationships between application classes are defined.
Parameters:
attr - Application class attribute name.
col - Relation column name (equal to attr by default).
vcls - Class of referenced object(s).
link - Many-to-many link relation name.
vcol - Relation column name of referenced object(s).
vattr - Attribute name of referenced object(s).
update - Used with 1-n associations. If true, then update referenced objects on relationship update, otherwise add appended objects and delete removed objects.

See Also: bazaar.conf.Column

getColumns(self)

Return list of all defined columns including inherited.

Static Method Details

__new__(self, name, bases=(<class 'bazaar.core.PersistentObject'>,), data=None, relation=None, sequencer=None, modname='bazaar.conf')

Create application class.
Parameters:
relation - Database relation name.
sequencer - Name of primary key values generator sequencer.
modname - Module of the application class, i.e. app.business.
Overrides:
__builtin__.type.__new__

Instance Variable Details

cache

Object cache class.

columns

List of application class attribute descriptions.

defaults

Default values for class attributes.

relation

Database relation name.

sequencer

Name of primary key values generator sequencer.

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