|
@@ -467,3 +467,46 @@ class _LeCrud(object):
|
467
|
467
|
def _field_is_relational(field):
|
468
|
468
|
return field.startswith('superior.') or field.startswith('subordinate')
|
469
|
469
|
|
|
470
|
+## @page leobject_filters LeObject query filters
|
|
471
|
+# The LeObject API provide methods that accept filters allowing the user
|
|
472
|
+# to query the database and fetch LodelEditorialObjects.
|
|
473
|
+#
|
|
474
|
+# The LeObject API translate those filters for the datasource.
|
|
475
|
+#
|
|
476
|
+# @section api_user_side API user side filters
|
|
477
|
+# Filters are string expressing a condition. The string composition
|
|
478
|
+# is as follow : "<FIELD> <OPERATOR> <VALUE>"
|
|
479
|
+# @subsection fpart FIELD
|
|
480
|
+# @subsubsection standart fields
|
|
481
|
+# Standart fields, represents a value of the LeObject for example "title", "lodel_id" etc.
|
|
482
|
+# @subsubsection rfields relationnal fields
|
|
483
|
+# relationnal fields, represents a relation with the object hierarchy. Those fields are composed as follow :
|
|
484
|
+# "<RELATION>.<NATURE>".
|
|
485
|
+#
|
|
486
|
+# - Relation can takes two values : superiors or subordinates
|
|
487
|
+# - Nature is a relation nature ( see EditorialModel.classtypes )
|
|
488
|
+# Examples : "superiors.parent", "subordinates.translation" etc.
|
|
489
|
+# @note The field_list arguement of leapi.leapi._LeObject.get() use the same syntax than the FIELD filter part
|
|
490
|
+# @subsection oppart OPERATOR
|
|
491
|
+# The OPERATOR part of a filter is a comparison operator. There is
|
|
492
|
+# - standart comparison operators : = , <, > , <=, >=, !=
|
|
493
|
+# - vagueness string comparison 'like' and 'not like'
|
|
494
|
+# - list operators : 'in' and 'not in'
|
|
495
|
+# The list of allowed operators is sotred at leapi.leapi._LeObject._query_operators .
|
|
496
|
+# @subsection valpart VALUE
|
|
497
|
+# The VALUE part of a filter is... just a value...
|
|
498
|
+#
|
|
499
|
+# @section datasource_side Datasource side filters
|
|
500
|
+# As said above the API "translate" filters before forwarding them to the datasource.
|
|
501
|
+#
|
|
502
|
+# The translation process transform filters in tuple composed of 3 elements
|
|
503
|
+# ( @ref fpart , @ref oppart , @ref valpart ). Each element is a string.
|
|
504
|
+#
|
|
505
|
+# There is a special case for @ref rfields : the field element is a tuple composed with two elements
|
|
506
|
+# ( RELATION, NATURE ) where NATURE is a string ( see EditorialModel.classtypes ) and RELATION is one of
|
|
507
|
+# the defined constant :
|
|
508
|
+#
|
|
509
|
+# - leapi.leapi.REL_SUB for "subordinates"
|
|
510
|
+# - leapi.leapi.REL_SUP for "superiors"
|
|
511
|
+#
|
|
512
|
+# @note The filters translation process also check if given field are valids compared to the concerned letype and/or the leclass
|