From 9b012f25668035dda4f7aafb31503c59cdbfa139 Mon Sep 17 00:00:00 2001 From: Yann Date: Thu, 17 Dec 2015 14:19:46 +0100 Subject: [PATCH] Moved the doxygen leobject_filter in lecrud + update it --- leapi/lecrud.py | 43 +++++++++++++++++++++++++++++++++++++++++++ leapi/leobject.py | 43 ------------------------------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/leapi/lecrud.py b/leapi/lecrud.py index 4bb68e9..2fa22f3 100644 --- a/leapi/lecrud.py +++ b/leapi/lecrud.py @@ -467,3 +467,46 @@ class _LeCrud(object): def _field_is_relational(field): return field.startswith('superior.') or field.startswith('subordinate') +## @page leobject_filters LeObject query filters +# The LeObject API provide methods that accept filters allowing the user +# to query the database and fetch LodelEditorialObjects. +# +# The LeObject API translate those filters for the datasource. +# +# @section api_user_side API user side filters +# Filters are string expressing a condition. The string composition +# is as follow : " " +# @subsection fpart FIELD +# @subsubsection standart fields +# Standart fields, represents a value of the LeObject for example "title", "lodel_id" etc. +# @subsubsection rfields relationnal fields +# relationnal fields, represents a relation with the object hierarchy. Those fields are composed as follow : +# ".". +# +# - Relation can takes two values : superiors or subordinates +# - Nature is a relation nature ( see EditorialModel.classtypes ) +# Examples : "superiors.parent", "subordinates.translation" etc. +# @note The field_list arguement of leapi.leapi._LeObject.get() use the same syntax than the FIELD filter part +# @subsection oppart OPERATOR +# The OPERATOR part of a filter is a comparison operator. There is +# - standart comparison operators : = , <, > , <=, >=, != +# - vagueness string comparison 'like' and 'not like' +# - list operators : 'in' and 'not in' +# The list of allowed operators is sotred at leapi.leapi._LeObject._query_operators . +# @subsection valpart VALUE +# The VALUE part of a filter is... just a value... +# +# @section datasource_side Datasource side filters +# As said above the API "translate" filters before forwarding them to the datasource. +# +# The translation process transform filters in tuple composed of 3 elements +# ( @ref fpart , @ref oppart , @ref valpart ). Each element is a string. +# +# There is a special case for @ref rfields : the field element is a tuple composed with two elements +# ( RELATION, NATURE ) where NATURE is a string ( see EditorialModel.classtypes ) and RELATION is one of +# the defined constant : +# +# - leapi.leapi.REL_SUB for "subordinates" +# - leapi.leapi.REL_SUP for "superiors" +# +# @note The filters translation process also check if given field are valids compared to the concerned letype and/or the leclass diff --git a/leapi/leobject.py b/leapi/leobject.py index d9814f4..cb18788 100644 --- a/leapi/leobject.py +++ b/leapi/leobject.py @@ -353,46 +353,3 @@ class LeObjectError(Exception): class LeObjectQueryError(LeObjectError): pass - -## @page leobject_filters LeObject query filters -# The LeObject API provide methods that accept filters allowing the user -# to query the database and fetch LodelEditorialObjects. -# -# The LeObject API translate those filters for the datasource. -# -# @section api_user_side API user side filters -# Filters are string expressing a condition. The string composition -# is as follow : " " -# @subsection fpart FIELD -# @subsubsection standart fields -# Standart fields, represents a value of the LeObject for example "title", "lodel_id" etc. -# @subsubsection rfields relationnal fields -# relationnal fields, represents a relation with the object hierarchy. Those fields are composed as follow : -# ".". -# -# - Relation can takes two values : superiors or subordinates -# - Nature is a relation nature ( see EditorialModel.classtypes ) -# Examples : "superiors.parent", "subordinates.translation" etc. -# @note The field_list arguement of leapi.leapi._LeObject.get() use the same syntax than the FIELD filter part -# @subsection oppart OPERATOR -# The OPERATOR part of a filter is a comparison operator. There is -# - standart comparison operators : = , <, > , <=, >=, != -# - list operators : 'in' and 'not in' -# The list of allowed operators is sotred at leapi.leapi._LeObject._query_operators . -# @subsection valpart VALUE -# The VALUE part of a filter is... just a value... -# -# @section datasource_side Datasource side filters -# As said above the API "translate" filters before forwarding them to the datasource. -# -# The translation process transform filters in tuple composed of 3 elements -# ( @ref fpart , @ref oppart , @ref valpart ). Each element is a string. -# -# There is a special case for @ref rfields : the field element is a tuple composed with two elements -# ( RELATION, NATURE ) where NATURE is a string ( see EditorialModel.classtypes ) and RELATION is one of -# the defined constant : -# -# - leapi.leapi.REL_SUB for "subordinates" -# - leapi.leapi.REL_SUP for "superiors" -# -# @note The filters translation process also check if given field are valids compared to the concerned letype and/or the leclass