Cleaning code for EmComponent
Optimizing tests for EmComponent and EmFieldGroup (running initDb in setUpModule and make a backup copy, the backup is restored in setUp)
- 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
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.
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.