No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

leclass.py 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #-*- coding: utf-8 -*-
  2. import leapi
  3. from leapi.leobject import _LeObject
  4. ## @brief Represent an EmClass data instance
  5. # @note Is not a derivated class of LeObject because the concrete class will be a derivated class from LeObject
  6. class _LeClass(_LeObject):
  7. ## @brief Stores fieldtypes by field name
  8. _fieldtypes = dict()
  9. ## @brief Stores authorized link2type
  10. _linked_types = list()
  11. ## @brief Stores fieldgroups and the fields they contains
  12. _fieldgroups = dict()
  13. ## @brief Stores the EM uid
  14. _class_id = None
  15. ## @brief Stores the classtype
  16. _classtype = None
  17. ## @brief Instanciate a new LeClass
  18. # @note Abstract method
  19. # @param **kwargs
  20. def __init__(self, **kwargs):
  21. raise NotImplementedError("Abstract class")
  22. @classmethod
  23. def fieldtypes(cls):
  24. ret = dict()
  25. ret.update(super(_LeClass,cls).fieldtypes())
  26. ret.update(cls._fieldtypes)
  27. return ret
  28. @classmethod
  29. def fieldlist(cls):
  30. return cls.fieldtypes().keys()