Package gavo :: Package rsc :: Module table :: Class BaseTable
[frames] | no frames]

Class BaseTable

source code

         object --+    
                  |    
base.meta.MetaMixin --+
                      |
         object --+   |
                  |   |
  common.ParamMixin --+
                      |
                     BaseTable
Known Subclasses:

is a container for row data.

Tables consist of rows, where each row maps column names to their value for that row. The rows are accessible at least by iterating over a table.

Tables get constructed with a tableDef and keyword arguments. For convenience, tables must accept any keyword argument and only pluck those out it wants.

Here's a list of keywords used by BaseTables or known subclasses:

You can add rows using the addRow method. For bulk additions, however, it may be much more efficient to call getFeeder (though for in-memory tables, there is no advantage).

Tables can run "scripts" if someone furnishes them with a _runScripts method. This currently is only done for DBTables. See Scripting_.

Initial Metadata is populated from the tableDef.

Tables have to implement the following methods:

Instance Methods
 
__init__(self, tableDef, **kwargs)
is a constructor for standalone use.
source code
 
__iter__(self, *args, **kwargs) source code
 
__len__(self, *args, **kwargs) source code
 
removeRow(self, *args, **kwargs) source code
 
addRow(self, *args, **kwargs) source code
 
getRow(self, *args, **kwargs) source code
 
getFeeder(self, *args, **kwargs) source code
 
addTuple(self, tupRow) source code
 
importFinished(self) source code
 
importFailed(self, *excInfo) source code
 
close(self) source code
 
runScripts(self, phase, **kwargs) source code
 
validateParams(self)
raises a ValidationError if any required parameters of this tables are None.
source code

Inherited from base.meta.MetaMixin: addMeta, buildRepr, copyMetaFrom, delMeta, getAllMetaPairs, getMeta, getMetaKeys, getMetaParent, isEmpty, iterMeta, keys, makeOriginal, setMeta, setMetaParent, traverse

Inherited from common.ParamMixin: getParam, getParamByName, getParamByUtype, getParamDict, iterParams, setParam, setParams

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, tableDef, **kwargs)
(Constructor)

source code 

is a constructor for standalone use. You do *not* want to call this when mixing into a Structure.

Overrides: object.__init__
(inherited documentation)