Skip to content
Browse files

Update rest-api.rst

Adding info about using comparison operators for querying resources.
  • Loading branch information...
1 parent 76576fd commit 8dac79462e23a1d369bb2e0211e98f20f9bde288 @yigitbey yigitbey committed
Showing with 29 additions and 0 deletions.
  1. +29 −0 docs/rest-api.rst
View
29 docs/rest-api.rst
@@ -430,6 +430,35 @@ Joins can be traversed using the django double-underscore notation:
]
}
+It is also supported to use different comparison operators with the same double-underscore notation:
+
+.. code-block:: console
+
+ $ curl http://127.0.0.1:5000/api/user/?user__lt=2
+
+.. code-block:: javascript
+
+ {
+ "meta": {
+ "model": "user",
+ "next": "",
+ "page": 1,
+ "previous": ""
+ },
+ "objects": [{
+ "username": "admin",
+ "admin": true,
+ "email": "admin@admin",
+ "active": true,
+ "password": "214de$25",
+ "id": 1
+ }]
+ }
+
+
+Valid Comparison Operators are:
+ 'eq', 'lt', 'lte', 'gt', 'gte', 'ne', 'in', 'is', 'like', 'ilike'
+
Sorting results
---------------

0 comments on commit 8dac794

Please sign in to comment.
Something went wrong with that request. Please try again.