暫無描述
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.1KB

123456789101112131415161718192021222324252627282930313233
  1. #-*- coding: utf-8 -*-
  2. import leobject
  3. ## @brief Represent an EmClass data instance
  4. # @note Is not a derivated class of LeObject because the concrete class will be a derivated class from LeObect
  5. class LeClass(object):
  6. ## @brief Stores fieldtypes by field name
  7. _fieldtypes = dict()
  8. ## @brief Stores relation with some LeType using rel2type fields. Key = rel2type fieldname value = LeType class
  9. _linked_types = dict()
  10. ## @brief Stores fieldgroups and the fields they contains
  11. _fieldgroups = dict()
  12. ## @brief Instanciate a new LeClass
  13. # @param model Model : The editorial model
  14. # @param datasource ? : The datasource
  15. def __init__(self, **kwargs):
  16. raise NotImplementedError("Abstract class")
  17. ## @brief Get the linked objects
  18. # @return an array of LeType derivated class instance
  19. def linked(self):
  20. pass
  21. ## @brief Link this class with an LeObject
  22. # @param leo LeObject : The object to be linked with
  23. # @return True if success False allready done
  24. # @throw A Leo exception if the link is not allowed
  25. def link_to(self, leo):
  26. pass