|
@@ -77,6 +77,9 @@ class DjangoMigrationHandler(object):
|
77
|
77
|
|
78
|
78
|
## @brief Record a change in the EditorialModel and indicate wether or not it is possible to make it
|
79
|
79
|
# @note The states ( initial_state and new_state ) contains only fields that changes
|
|
80
|
+ #
|
|
81
|
+ # @note Migration is not applied by this method. This method only checks if the new em is valid
|
|
82
|
+ #
|
80
|
83
|
# @param em model : The EditorialModel.model object to provide the global context
|
81
|
84
|
# @param uid int : The uid of the change EmComponent
|
82
|
85
|
# @param initial_state dict | None : dict with field name as key and field value as value. Representing the original state. None mean creation of a new component.
|
|
@@ -98,7 +101,8 @@ class DjangoMigrationHandler(object):
|
98
|
101
|
self.em_to_models(em)
|
99
|
102
|
try:
|
100
|
103
|
#Calling makemigrations to see if the migration is valid
|
101
|
|
- django_cmd('makemigrations', self.app_name, dry_run=True, intercative=True, merge=True, noinput=True)
|
|
104
|
+ #django_cmd('makemigrations', self.app_name, dry_run=True, intercative=True, merge=True, noinput=True)
|
|
105
|
+ django_cmd('makemigrations', self.app_name, dry_run=True, intercative=True, noinput=True)
|
102
|
106
|
except django.core.management.base.CommandError as e:
|
103
|
107
|
raise MigrationHandlerChangeError(str(e))
|
104
|
108
|
|
|
@@ -131,6 +135,7 @@ class DjangoMigrationHandler(object):
|
131
|
135
|
pass
|
132
|
136
|
|
133
|
137
|
## @brief Not usefull ?
|
|
138
|
+ # @note Maybe we can (have to?) use it to actually do migrations
|
134
|
139
|
def register_model_state(self, em, state_hash):
|
135
|
140
|
print('OHOHOH !!! i\'ve been called')
|
136
|
141
|
pass
|