Trees | Indices | Help |
|
---|
|
This class is the main interface. Normally, you derive a class from
this to represent a table in the database. Each of your derived classes
MUST contain an attribute COL_type
which specifies what
columns are in that table. Each derived class will have a unique ID
number called id
; this will be a column in the database, and
it will be stored in each instance object. The DBx class manages
that ID number for you.
Beyond that, a derived class MUST redefine _fromtuple.
Nested Classes | |
__metaclass__ This is used by all the SQL classes, and initializes the class. (Inherited from gmisclib.sqlbase.DB) |
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
int |
|
||
Inherited from |
Class Methods | |||
|
|||
|
|||
|
|||
None |
|
||
None |
|
||
|
|||
|
|||
|
|||
|
Class Variables | |
COL_type a sequence of (column_name, data_type_name) pairs.
|
|
SQL_name =
the name of the corresponding table in the database. |
|
S_inDB = 1
(Inherited from gmisclib.sqlbase.DB)
|
|
S_modified = 2
(Inherited from gmisclib.sqlbase.DB)
|
|
S_notinDB = 0
(Inherited from gmisclib.sqlbase.DB)
|
|
idx the lowest unused ID number. |
Instance Variables | |
id the instance's ID number. |
Properties | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
repr(x)
|
Class Variable Details |
COL_typea sequence of(column_name, data_type_name) pairs. Those
name the columns of the table and tell what type of data is in each.
data_type_name must be the name of a legal sqlite3 data type
OR, it must be "FKEY tablename column_name" where
tablename is the name of the table into which the foreign key
points and column_name is the name of the column in that table.
Typical tuples in COL_type are
("Number_of_dogs", "INTEGER") or
("dog_id", "FKEY dog_info id") . Note
that COL_type should not include the ID number, which is
always column id ; it is added automatically.
|
SQL_namethe name of the corresponding table in the database. This defaults to the name of the leaf class.
|
Instance Variable Details |
idthe instance's ID number. Note that an ID number is allocated for every instance you create. Instances you look up withselect
won't necesarily be new: they bay just be a pointer to an existing,
perhaps cached instance. The ID number of an instance is persistant and
is written into the database.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Sep 22 04:25:10 2011 | http://epydoc.sourceforge.net |