Now EmComponents gets a Model instance when instanciate, and the Model._components dict structure has change a bit
Model._components now contains only one dict ( 'uids' key ) and the others are now list of EmComponent instances
Model now handle EVERY access to the _components dict
Code factorization and create methods for EmComponent and childs changes
Behaviour changed for EmComponent and childs create method :
- Takes care of duplicated names at creation
- Handle all the checks in EmComponent method
Factorization of EmField.get_class_table() method
Added a @property method class_table_name to EmClass
New way to specify _fields and table in EmComponent's child classes
Now _fields and table MUST be class attribute.
Its important to note that _fields now consist in a list of (name, ftype) tuples and that ftype is a EmFieldType class and NOT an EmFieldType instance
- Added a _fields property (also added it as class property, but the way its done is not satisfactory... we want an ordered dict and not a tuple list as class property)
- Its now allowed to give an uid or a name as em_class for EmFieldGroup.create(name, em_class).
- Now when EmFieldGroup.create is called with an existing name it raises an error (ValueError)
- Removed EmFieldGroup.populate and EmFieldGroup.save
Adding default date for date_create and date_update columns
The dates are set in EmComponent::create() for date_create and in EmComponent::save() for date_update
The values are sets to datetime.datetime.utcnow() so we now that EVERY date in the db are in UTC, no matter django, database or even server configurations.
We will have to take care to convert dates from database to django timezone in dates fieldtypes.