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.
Renaming and moving files + fixed a bug in Lodel.settings imports
Lodel/sttings/__init__.py wasn't able to import files when called by manage.py
Renaming em to EditorialModel and moved Em* objects to EditorialModel/lib
Adding a first test (that do not pass because of syntax errors in Em* classes)