1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-08-05 11:58:37 +02:00

Bugfix on pk fieldtype

This commit is contained in:
Yann 2015-10-23 11:33:06 +02:00
commit 6bc80ce40b

View file

@ -2,6 +2,7 @@
import EditorialModel.fieldtypes.integer
## @todo This EmFieldType is a bit dirty....
class EmFieldType(EditorialModel.fieldtypes.integer.EmFieldType):
help = 'Integer primary key fieldtype'
@ -13,6 +14,7 @@ class EmFieldType(EditorialModel.fieldtypes.integer.EmFieldType):
'nullable': False,
'uniq': False,
'internal': 'automatic',
'primary': True,
}
# Checking args
for name, value in kwargs.items():
@ -21,4 +23,5 @@ class EmFieldType(EditorialModel.fieldtypes.integer.EmFieldType):
if value != allowed[name]:
raise ValueError("The value '%s' for argument '%s' for pk EmFieldType is not allowed"%(value, name))
super(EmFieldType, self).__init__(primary=True, nullable=False)
super(EmFieldType, self).__init__(**kwargs)