Added filter operators
In this changeset, I refactored the DB filter system to support comparison operators using a django-like syntax. A filter can take 2 forms: - "<FIELDNAME>" which is a syntactic sugar for "<FIELDNAME>__eq" - "<FIELDNAME>__<OPERATOR>" where <OPERATOR> is the comparison operator to be used. Here is the list of the supported operators: - 'eq' (==) - 'neq' (!=) - 'gt' (>) - 'gte' (>=) - 'lt' (<) - 'lte' (<=) - 'in' (in) - 'notin' (not in) Change-Id: I53a61d50a3253342a40f0ff87cb5612ed57a3bd1
This commit is contained in:
committed by
David TARDIVEL
parent
7b403c0d3b
commit
77c07a466f
@@ -150,6 +150,11 @@ class InvalidIdentity(Invalid):
|
||||
msg_fmt = _("Expected a uuid or int but received %(identity)s")
|
||||
|
||||
|
||||
class InvalidOperator(Invalid):
|
||||
msg_fmt = _("Filter operator is not valid: %(operator)s not "
|
||||
"in %(valid_operators)s")
|
||||
|
||||
|
||||
class InvalidGoal(Invalid):
|
||||
msg_fmt = _("Goal %(goal)s is invalid")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user