Browse Source

[#50] Added the management of "integer" AND "int" in EmField (in the get_field_class method)

Roland Haroutiounian 9 years ago
parent
commit
d2d193e58f
2 changed files with 6 additions and 2 deletions
  1. 5
    1
      EditorialModel/fields.py
  2. 1
    1
      EditorialModel/fieldtypes/int.py

+ 5
- 1
EditorialModel/fields.py View File

@@ -57,7 +57,11 @@ class EmField(EmComponent):
57 57
     # @throw When not found
58 58
     # @see EmField::fieldtypes()
59 59
     def get_field_class(ftype, **kwargs):
60
-        ftype_module = importlib.import_module('EditorialModel.fieldtypes.%s'%ftype)
60
+        if ftype == 'integer':
61
+            ftype_module = importlib.import_module('EditorialModel.fieldtypes.int')
62
+        else:
63
+            ftype_module = importlib.import_module('EditorialModel.fieldtypes.%s'%ftype)
64
+
61 65
         return ftype_module.fclass
62 66
 
63 67
     @staticmethod

+ 1
- 1
EditorialModel/fieldtypes/int.py View File

@@ -10,6 +10,6 @@ class EmFieldInt(EmField):
10 10
     help = 'Basic integer field'
11 11
 
12 12
     def __init__(self, **kwargs):
13
-        super(EmFieldChar, self).__init__(**kwargs)
13
+        super(EmFieldInt, self).__init__(**kwargs)
14 14
 
15 15
 fclass=EmFieldInt

Loading…
Cancel
Save