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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. @classmethod
  18. def fieldtypes(cls):
  19. ret = dict()
  20. ret.update(super(_LeClass,cls).fieldtypes())
  21. ret.update(cls._fieldtypes)
  22. return ret
  23. @classmethod
  24. def fieldlist(cls):
  25. return list(cls.fieldtypes().keys())
  26. @classmethod
  27. def get(cls, query_filters, field_list=None, order=None, group=None, limit=None, offset=0):
  28. query_filters.append(('class_id', '=', cls._class_id))
  29. return super().get(query_filters, field_list, order=order, group=group, limit=limit, offset=offset)
  30. @classmethod
  31. def leo_class(cls):
  32. return cls