A model defines the following properties:
Prop. | Type | Default | Comment |
---|---|---|---|
name |
string |
no default | The name is the only
mandatory arguments when instanciating a Model. Once set, it should
not be changed |
packageName |
string |
value of name |
Dynamically |
adaptorName |
string |
'' |
|
connDict |
dict |
{ 'host': '', 'database': '', 'user': '', 'password': '' } |
|
entities |
sequence | [] |
Entities for the model are appended to this sequence. |
associations |
sequence | [] |
Associations are appended to this sequence. |
doc |
string |
'' |
this is the ``comment'' field |
version |
string |
no default | currently '0.1'
-see below |
When instanciated, a model should supply its name:
model = Model('AuthorBooks')
Properties can be set at instanciation time:
model = Model('AuthorBooks', adaptorName='Postgresql')
or by direct assignment:
model.adaptorName='Postgresql'