1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-06-13 22:20:47 +02:00

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

This commit is contained in:
Roland Haroutiounian 2015-09-23 14:47:06 +02:00
commit d2d193e58f
2 changed files with 6 additions and 2 deletions

View file

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

View file

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