Browse Source

Bugfixe in leobject

Deleted hardcoded condition that brokes standart field validation process
Yann Weber 8 years ago
parent
commit
0aec7f6ca8

BIN
examples/em_test.pickle View File


+ 1
- 1
lodel/leapi/datahandlers/base_classes.py View File

192
     # @param internal bool : if False, the field is not internal
192
     # @param internal bool : if False, the field is not internal
193
     # @param **kwargs : other arguments
193
     # @param **kwargs : other arguments
194
     def __init__(self, allowed_classes = None, back_reference = None, internal=False, **kwargs):
194
     def __init__(self, allowed_classes = None, back_reference = None, internal=False, **kwargs):
195
-        self.__allowed_classes = [] if allowed_classes is None else set(allowed_classes)
195
+        self.__allowed_classes = set() if allowed_classes is None else set(allowed_classes)
196
         logger.warning("We're going to inialize an temporary attribute, don't forget to fix this issue")
196
         logger.warning("We're going to inialize an temporary attribute, don't forget to fix this issue")
197
         if back_reference is not None:
197
         if back_reference is not None:
198
             if len(back_reference) != 2:
198
             if len(back_reference) != 2:

+ 1
- 1
lodel/leapi/leobject.py View File

499
         correct = set() #valid fields name
499
         correct = set() #valid fields name
500
         mandatory = set() #mandatory fields name
500
         mandatory = set() #mandatory fields name
501
         for fname, datahandler in cls._fields.items():
501
         for fname, datahandler in cls._fields.items():
502
-            if allow_internal or not datahandler.is_internal() or fname == CLASS_ID_FIELDNAME:
502
+            if allow_internal or not datahandler.is_internal():
503
                 correct.add(fname)
503
                 correct.add(fname)
504
                 if complete and not hasattr(datahandler, 'default'):
504
                 if complete and not hasattr(datahandler, 'default'):
505
                     mandatory.add(fname)
505
                     mandatory.add(fname)

BIN
tests/editorial_model.pickle View File


Loading…
Cancel
Save