Package Modeling :: Module PyModel :: Class Model
[show private | hide private]
[frames | no frames]

Class Model

BaseDescription --+
                  |
                 Model


Describes a Model
Method Summary
  __init__(self, name, **kw)
  addEntity(self, entityDescObj)
add entity to model
  build(self)
  build_associations(self)
  createDBSchema(self, entityName)
drops and recreates from scratch
  entityNamed(self, name)
  generateDBSchema(self, entityName)
Generate SQL only
  generatePython(self, entityName)
generate code for model, or only for entityName if specified
  removeEntity(self, name)
remove entity from model
  toXML(self)
  updateDBSchema(self, mode, entityName)
operate on existing tables (and defined by this schema), employing mode: - check: only report differences between model and existent DB - incremental: only add/modify columns in existing tables - clean: add/modify new columns/tables, and drop obsolete ones Note: renaming of columns or tables?
  validate(self)
validate this model instance
    Inherited from BaseDescription
  clone(self, descriptionObject)
return an independant copy of object
  defaultedField(self, field, defaultValue)
  requiredField(self, field)
make test more useful
  update(self)

Class Variable Summary
dict defaults = {'associations': [], 'entities': [], 'doc': '...
    Inherited from BaseDescription
str VERSION = '0.1'

Method Details

addEntity(self, entityDescObj)

add entity to model

createDBSchema(self, entityName=None)

drops and recreates from scratch

generateDBSchema(self, entityName=None)

Generate SQL only

generatePython(self, entityName=None)

generate code for model, or only for entityName if specified

removeEntity(self, name)

remove entity from model

updateDBSchema(self, mode, entityName=None)

operate on existing tables (and defined by this schema), employing mode: - check: only report differences between model and existent DB - incremental: only add/modify columns in existing tables - clean: add/modify new columns/tables, and drop obsolete ones Note: renaming of columns or tables?

validate(self)

validate this model instance

Class Variable Details

defaults

Type:
dict
Value:
{'adaptorName': '',
 'associations': [],
 'connDict': {'host': '', 'password': '', 'user': '', 'database': ''},
 'doc': '',
 'entities': [],
 'packageName': <function identity at 0xb6a3cb8c>('name',)}            

Generated by Epydoc 2.1 on Sat Mar 4 13:36:23 2006 http://epydoc.sf.net