Browse Source

Updated the django listfieldtype command (useless since we planned to remove django -_-) + disabling the LodelTestInstance calls to djangoMh

Yann Weber 9 years ago
parent
commit
c0bea01d0e

+ 2
- 0
EditorialModel/migrationhandler/django.py View File

13
 
13
 
14
 from EditorialModel.exceptions import *
14
 from EditorialModel.exceptions import *
15
 
15
 
16
+## @package EditorialModel::migrationhandler::django
17
+# @deprecated Broken since EmField and fieldtypes changed
16
 
18
 
17
 ## @brief Create a django model
19
 ## @brief Create a django model
18
 # @param name str : The django model name
20
 # @param name str : The django model name

+ 3
- 3
Lodel/management/commands/listfieldtypes.py View File

1
 from django.core.management.base import BaseCommand, CommandError
1
 from django.core.management.base import BaseCommand, CommandError
2
 from optparse import make_option
2
 from optparse import make_option
3
-from EditorialModel.fields import EmField
3
+import EditorialModel
4
 
4
 
5
 class Command(BaseCommand):
5
 class Command(BaseCommand):
6
     option_list = BaseCommand.option_list + (
6
     option_list = BaseCommand.option_list + (
13
     help = 'List all the possible field types'
13
     help = 'List all the possible field types'
14
 
14
 
15
     def handle(self, *args, **options):
15
     def handle(self, *args, **options):
16
-        ftl = EmField.fieldtypes_list()
16
+        ftl = EditorialModel.fields.EmField.fieldtypes_list()
17
         ftl.sort()
17
         ftl.sort()
18
         if options['silent']:
18
         if options['silent']:
19
             for ftype in ftl:
19
             for ftype in ftl:
21
         else:
21
         else:
22
             self.stdout.write("Field types list : ")
22
             self.stdout.write("Field types list : ")
23
             for ftype in ftl:
23
             for ftype in ftl:
24
-                self.stdout.write("\t{0:15} {1}".format(ftype, EmField.get_field_class(ftype).help))
24
+                self.stdout.write("\t{0:15} {1}".format(ftype, EditorialModel.fieldtypes.generic.GenericFieldType.from_name(ftype).help))

+ 2
- 2
LodelTestInstance/models.py View File

6
 from EditorialModel.model import Model
6
 from EditorialModel.model import Model
7
 from EditorialModel.backend.json_backend import EmBackendJson
7
 from EditorialModel.backend.json_backend import EmBackendJson
8
 
8
 
9
-
9
+""" #Commented because django Mh is broken
10
 if not settings.LODEL_MIGRATION_HANDLER_TESTS:
10
 if not settings.LODEL_MIGRATION_HANDLER_TESTS:
11
     me = Model(EmBackendJson('EditorialModel/test/me.json'), migration_handler = DummyMigrationHandler(True))
11
     me = Model(EmBackendJson('EditorialModel/test/me.json'), migration_handler = DummyMigrationHandler(True))
12
     dmh = DjangoMigrationHandler('LodelTestInstance', settings.DEBUG)
12
     dmh = DjangoMigrationHandler('LodelTestInstance', settings.DEBUG)
13
     models = dmh.em_to_models(me)
13
     models = dmh.em_to_models(me)
14
 elif settings.DEBUG:
14
 elif settings.DEBUG:
15
     print("Making migrations tests, don't generate the models in the models.py file but within the migrations handler check process")
15
     print("Making migrations tests, don't generate the models in the models.py file but within the migrations handler check process")
16
-
16
+"""
17
 
17
 

Loading…
Cancel
Save