Roland Haroutiounian
0bf24b6c48
[#45 ] Changed the return of the hash methods, we get integer instead of string
9 years ago
Yann Weber
084b8af6c1
MigrationHandler enhancement (now records Model's hash for each changes). Better beaviour of Model.create_component if MigrationHandler raises
9 years ago
Roland Haroutiounian
8a6fdd4c6a
[#45 ] Added the __hash__ method implementation for the Model class
9 years ago
Roland Haroutiounian
c916801c99
[#45 ] Changed the __hash__ implementation of the EmComponent class
9 years ago
Yann Weber
ed9133016f
Fixing component deletion
9 years ago
Yann Weber
fe9184f608
Reimplementig EmComponent::__setattr__ to call migration handler
Addding a method to indicate the end of a component initialisation phase (used in Model.load and Model.create_component)
Adding a method that dump component attributes (used in Model.create_component and Model.delete_component to call the migration_handler)
9 years ago
Yann Weber
195cca24a4
Implementing check methods for each EmComponent child (and EmComponent)
No extended checks was done. Only tested if the check passes without syntax error and without failing with no reason
9 years ago
Yann Weber
405dd318dd
Added type check in EmComponent and childs class type check. Added some cast functions to Backend
9 years ago
Yann Weber
b6ef37752f
Supressed _fields from EmComponent and transforming the EmComponent in a standart object with standarts attributes
9 years ago
Yann Weber
a2529cf8eb
Added a check method to EmComponent and EmClass
EmComponent::check() always return True but rearrange ranks if they are not continuous
9 years ago
Yann Weber
8bf864c597
Handling rank sorting in Model and rank modifier in EmComponent
9 years ago
ArnAud
4803eba6a7
EmComponent: access to model is now named model !!
9 years ago
Yann Weber
b87c276b26
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
9 years ago
Yann Weber
6a56b31ba5
Migrating EmClass methods and EmComponent.delete according to the new Model object, changed the Model.components dict keys (and the json test file)
There is now two methods Model.name_from_emclass and emclass_from_name that allows to access the Model.components array
9 years ago
ArnAud
79336030c7
EM: store in each component a reference to the list of the other
9 years ago
ArnAud
c73251795c
EM: first draft for a Model Class
9 years ago
ArnAud
1d2c069fb8
EmComponent: get rid of database functions
9 years ago
Roland Haroutiounian
79c168587e
[pep8] Correction sur les lignes vides entre les classes et les méthodes
9 years ago
Yann Weber
889abc8547
Put the database configuration asinstance attribute of EmComponent
9 years ago
Yann Weber
cd37b0129f
Better comments for set_rank method
9 years ago
Yann Weber
d7d4a989f1
TODO on EmComponent
9 years ago
Roland Haroutiounian
b03958a65a
Suppression de sqlutils.getEngine au profit de sqlutils.get_engine
9 years ago
Yann Weber
49dfe9ad03
Code factorization on EmComponent.modify_rank()
Changed beahvior : when a 'non-change' is asked (like +0 -0 or set ranke to actual rank) don't raise an Error
9 years ago
Yann Weber
f41d164603
Added test for EmComponent.get_max_rank(), replacing the default value for rank by the one processed by get_max_rank
9 years ago
Yann Weber
6af0b45f3f
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
9 years ago
Yann Weber
27d178e531
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
9 years ago
Driky
347a302e85
Correction: ajout de la valeur de ranked_in pour chaque classe 'em_*'
9 years ago
Yann Weber
a3b9daf319
sqlwrapper deletion and sqlsetup enhancement
Moved the database initialisation functionnality to sqlsetup and fixed all the code to handle the sqlwrapper deletion
9 years ago
Roland Haroutiounian
43bb085667
[EmField] Modification AddColumn + test ranked_in dans Components repassé temporairement à -1
9 years ago
Driky
847509590a
Correction de Component. cl -> cls
9 years ago
Driky
c3560d3feb
Correction sur Component pour passer get_max_rank en classmethod
9 years ago
Driky
3b97054d3b
Petite correction sur le rank initial
9 years ago
Yann Weber
4fb2f789b5
Replacing EmComponent method getDbE by db_engine
9 years ago
Yann Weber
e87fa84eac
Updating some comments and changing getDbE method name
Maintaining an alias for the new EmComponent.db_engine
9 years ago
ArnAud
c95b37df12
EmComponent: pep8 et pylint
9 years ago
Yann Weber
a042306c14
Delete implementation for EmClass and EmField
The EmField version cannot be tested yet (drop column not yet implemented for sqlite in Database.sqlalter)
9 years ago
Driky
91ea809d5b
Correction de Component.modify_rank()
Passe tous les tests
9 years ago
Driky
39c63f8ee3
Correction des cas sign = + ou - sur modify rank et creation de get_max_rank()
9 years ago
Yann Weber
00614d90e9
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
9 years ago
Yann Weber
80e82073fc
Bugfixes on EmComponent
- Now except for the modify_rank tests test_component didn't fails
- Added simple integer operation capabilities to EmFieldType_integer ( int cast, +=, -=, *=, /=, +, -, *, /, %, ...)
9 years ago
Yann Weber
690b68d714
Small bugfix in components.py
9 years ago
Yann Weber
ff72825720
Normalize comments for components.py
9 years ago
ArnAud
ac6a2883f2
EmComponents: close db connexion after fetching (sqlite issue)
9 years ago
Yann Weber
97c6b41e88
Close #31
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
9 years ago
Driky
615bfc5a81
EM Component.py Commentaire
Correction du bloc de mcommentaire de class encore sous l'ancien modèle.
9 years ago
Driky
a611b08e37
EM Component.py modify_rank
remplacement des self.id restant par self.uid
9 years ago
Yann Weber
7e8414c162
Close ticket #29 and bugfix
Now EmComponent is populate if it's instanciated with a name or an id
9 years ago
Driky
7fc1260ffc
Mr correction is here
9 years ago
ArnAud
76da309f4c
EM: put data fields in a dict, simplify save() and populate()
9 years ago
Driky
64fd3317a6
Correction #13542113
9 years ago