| Home | Trees | Index | Help |
|
|---|
| Package pydo :: Module base :: Class ForeignKey |
|
object --+
|
ForeignKey
descriptor that enables succinct creation of foreign key attributes.
Both single-column and multi-column foreign key associations are supported.
Example usage:
class A(PyDO):
fields=(Sequence('id'),
'b_fkey',
'c_fkey1',
'c_fkey2')
B=ForeignKey('b_fkey', 'id', B)
C=ForeignKey(('c_fkey1', 'c_fkey2'), ('key1', 'key2'), C)
a=A.getUnique(id=1)
a.B # returns B.getUnique(id=a.b_fkey)
a.C # returns C.getUnique(key1=a.c_fkey1, key2=a.c_fkey2)
a.C=my_C_instance # updates a with new values for c_fkey1 and c_fkey2
a.B=None # equivalent to a.b_fkey=None
| Method Summary | |
|---|---|
| |
__get__(self,
obj,
type_)
| |
__set__(self,
obj,
value)
| |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
| Property Summary | |
|---|---|
kls | |
| Method Details |
|---|
__init__(self,
this_side,
that_side,
kls)
|
| Property Details |
|---|
kls
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.0 on Wed Mar 8 10:18:59 2006 | http://epydoc.sf.net |