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.

__init__.py 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. from lodel.leapi.datahandlers.base_classes import DataHandler
  2. DataHandler.load_base_handlers()
  3. ## @defgroup lodel2_datahandlers Datahandlers
  4. # @ingroup lodel2_leapi
  5. # @ingroup lodel2_em
  6. ## @defgroup lodel2_dh_checks Datahandlers datas checking
  7. # @ingroup lodel2_datahandlers
  8. ## @package lodel.leapi.datahandlers Lodel2 datahandlers
  9. #
  10. # Datahandlers are object that handles datas check, construction and
  11. # consistency check
  12. #
  13. ## @page lodel2_dh_checks_page Datahandlers datas checking
  14. # @ingroup lodel2_dh_checks
  15. #
  16. # @section lodel2_dh_check_mech Datas checking mechanism
  17. #
  18. # The data checking mechanism is divided into 3 stages :
  19. # 1. **value checking** : a basic value check. Example : is len(value) < 52 ?
  20. # 2. **data construction** : for data that needs to be modified. Example :
  21. # a date that will be transformed into a Datetime object associated with a
  22. # timezone
  23. # 3. **data consistency checking** : performs a consistency checking on the
  24. # object from the "point of view" of the current field. Example : is the
  25. # given lodel_id an identifier of an Article ?
  26. #
  27. # @subsection lodel2_dh_check_impl Implementation
  28. #
  29. # Those three stages are implemented by 3 datahandlers methods :
  30. # - @ref base_classes.DataHandler.check_data_value() "check_data_value"
  31. # - @ref base_classes.DataHandler.construct_data() "construct_data"
  32. # - @ref base_classes.DataHandler.check_data_value() "check_data_consitency"
  33. #
  34. # @note To ensure the calls of the base classes methods child classes implements
  35. # those method with a '_' prefix :
  36. # - @ref base_classes.DataHandler._check_data_value "_check_data_value()"
  37. # - @ref base_classes.DataHandler._construct_data() "_construct_data"
  38. # - @ref base_classes.DataHandler._check_data_value() "_check_data_consitency"
  39. #
  40. # Examples of child classes can be found @ref datahandlers.datas "here"
  41. #
  42. # @subsubsection lodel2_dh_datas_construction Datas construction
  43. #
  44. # When constructing a data handled by a datahandler we may need to have access
  45. # to other datas in the object (see @ref base_classes.DataHandler.construct_data() "construct_data() arguments").
  46. #
  47. # The problem resides in the construction order, if we need other data we have
  48. # to be sure that they are already constructed. To achieve this goal the data
  49. # dictionary given as arguement to @ref base_classes.DataHandler.construct_data() "construct_data()"
  50. # is a @ref base_classes.DatasConstructor "DatasConstructor" instance. This class
  51. # checks if a data is constructed when trying to access it, if not it runs
  52. # the corresponding construct_data() (and have a circular dependencies detection
  53. # mechanism)
  54. #
  55. #@see base_classes.DatasConstructor.