Home | Trees | Indices | Help |
|
---|
|
object --+ | dict --+ | Table --+ | KeyedTable
an instance of this class represents a database keyed table
Example:
db = DAL(...) db.define_table('account', Field('accnum','integer'), Field('acctype'), Field('accdesc'), primarykey=['accnum','acctype']) db.users.insert(accnum=1000,acctype='A',accdesc='Assets') db.users.drop() db.define_table('subacct', Field('sanum','integer'), Field('refnum','reference account.accnum'), Field('reftype','reference account.acctype'), Field('sadesc','string'), primarykey=['sanum']))
Notes: 1) primarykey is a list of the field names that make up the primary key 2) all primarykey fields will have NOT NULL set even if not specified 3) references are to other keyed tables only 4) references must use tablename.fieldname format, as shown above 5) update_record function is not available
|
|||
new empty dictionary |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
Initializes the table and performs checking on the provided fields. If a field is of type Table, the fields (excluding 'id') from that table will be used instead. :raises SyntaxError: when a supplied field is of incorrect type.
|
|
x[y]
|
x[i]=y
|
del x[y]
|
repr(x)
|
|
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Feb 3 10:53:21 2010 | http://epydoc.sourceforge.net |