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.

classes.py 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # -*- coding: utf-8 -*-
  2. """ Manipulate Classes of the Editorial Model
  3. Create classes of object
  4. @see EmClass, EmType, EmFieldGroup, EmField
  5. """
  6. from EditorialModel.components import EmComponent, EmComponentNotExistError
  7. import EditorialModel.classtypes
  8. from Database.sqlwrapper import SqlWrapper
  9. class EmClass(EmComponent):
  10. def __init__(self, id_or_name):
  11. self.table = 'em_class'
  12. super(EmClass, self).__init__(id_or_name)
  13. """ create a new class
  14. @param name str: name of the new class
  15. @param class_type EmClasstype: type of the class
  16. """
  17. @staticmethod
  18. def create(name, class_type):
  19. #try:
  20. exists = EmClass(name)
  21. #except EmComponentNotExistError:
  22. #print ("bin")
  23. #pass
  24. print (name, class_type)
  25. pass
  26. """ retrieve list of the field_groups of this class
  27. @return field_groups [EmFieldGroup]:
  28. """
  29. def field_groups():
  30. pass
  31. """ retrieve list of fields
  32. @return fields [EmField]:
  33. """
  34. def fields():
  35. pass
  36. """ retrieve list of type of this class
  37. @return types [EmType]:
  38. """
  39. def types():
  40. pass
  41. """ add a new EmType that can ben linked to this class
  42. @param t EmType: type to link
  43. @return success bool: done or not
  44. """
  45. def link_type(t):
  46. pass
  47. """ retrieve list of EmType that are linked to this class
  48. @return types [EmType]:
  49. """
  50. def linked_types():
  51. pass