|
@@ -57,6 +57,9 @@ class DataHandler(object):
|
57
|
57
|
del(kwargs['default'])
|
58
|
58
|
for argname, argval in kwargs.items():
|
59
|
59
|
setattr(self, argname, argval)
|
|
60
|
+
|
|
61
|
+ if self.is_primary_key() and not self.is_uniq():
|
|
62
|
+ raise LodelException("'primary_key' field has to be uniq")
|
60
|
63
|
|
61
|
64
|
## Fieldtype name
|
62
|
65
|
@classmethod
|
|
@@ -73,6 +76,9 @@ class DataHandler(object):
|
73
|
76
|
|
74
|
77
|
def is_primary_key(self):
|
75
|
78
|
return self.primary_key
|
|
79
|
+
|
|
80
|
+ def is_uniq(self):
|
|
81
|
+ return self.uniq
|
76
|
82
|
|
77
|
83
|
##@brief checks if a fieldtype is internal
|
78
|
84
|
# @return bool
|