The component APrimaryKey redefines the following defaults:
Prop. | Type | Default | Comment |
---|---|---|---|
name |
string |
no default | The name is the only
mandatory arguments when instanciating a APrimaryKey. Once set, it
should not be changed |
isClassProperty |
int |
0 |
|
isRequired |
int |
1 |
You should not change this default, nor overwrite it: a primary key should be mandatory. |
defaultValue |
None if isClassProperty is
false, 0 otherwise |
||
doc |
string |
'Primary Key' |
|
usedForLocking |
int |
0 |
Every entity must define a primary key. However, most of the times, you do not want to explicitly declare a primary key in each of your entities, since they'll basically be the same. In this case, you'll simply add a primary key to the Entity's defaults:
Entity.defaults['properties'] = [ APrimaryKey('id', isClassProperty=0, isRequired=1, doc='PK') ]
Comments are welcome: Sebastien Bigaret / Modeling Home Page