Code factorization on EmType select and unselect fields. Added comparison capabilities to EmComponent (and childs)
Implemented __hash__ and __eq__ for EmComponent (based on class name and uid) to test equality betwenn two instance. Allows to use "instance in instance_list" syntax
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
EmComponent.create() now takes keywords arguments corresponding to the _fields property of the calling class
WARNING !!! Hardcoded rank = -1 at component creation and Hardcoded 0 as default value for EmClass icon
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.