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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 datas that needs to be modified. Example :
  21. #a date that will be transformed into a Datetime object associated with
  22. #a timezone
  23. # 3. **data consistency checking** : perform a consistency checking on the
  24. #object from the "point of view" of the current field. Example : is the given
  25. #lodel_id an identifier of a 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 '_' preffix :
  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. #Datas construction is a bit tricky. When constructing a data handled by a
  45. #datahandler we may need to have access to other datas in the object (see
  46. #@ref base_classes.DataHandler.construct_data() "construct_data() arguments").
  47. #
  48. #The problem reside in the construction order, if we need other datas we have
  49. #to be sure that they are allready constructed. To achieve this goal the datas
  50. #dict given as arguement to
  51. #@ref base_classes.DataHandler.construct_data() "construct_data()" is an
  52. #@ref base_classes.DatasConstructor "DatasConstructor" instance. This class
  53. #check if a data is constructed when trying to access to it, if not it runs
  54. #the corresponding construct_data() (and have a circular dependencies detection
  55. #mechanism)
  56. #
  57. #@see base_classes.DatasConstructor.