mirror of
https://github.com/yweber/lodel2.git
synced 2026-06-16 23:40:48 +02:00
Moved the doxygen leobject_filter in lecrud + update it
This commit is contained in:
parent
141ba96de3
commit
9b012f2566
2 changed files with 43 additions and 43 deletions
|
|
@ -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 : "<FIELD> <OPERATOR> <VALUE>"
|
||||
# @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>.<NATURE>".
|
||||
#
|
||||
# - 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
|
||||
|
|
|
|||
|
|
@ -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 : "<FIELD> <OPERATOR> <VALUE>"
|
||||
# @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>.<NATURE>".
|
||||
#
|
||||
# - 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue