@@ -198,6 +198,19 @@ Filtered list of objects:
198198
199199 customers = Customer.filter(Active = True , FamilyName = " Smith" , qb = client)
200200
201+ Filtered list of objects with ordering:
202+
203+ .. code-block :: python
204+
205+ # Get customer invoices ordered by TxnDate
206+ invoices = Invoice.filter(CustomerRef = ' 100' , order_by = ' TxnDate' , qb = client)
207+
208+ # Same, but in reverse order
209+ invoices = Invoice.filter(CustomerRef = ' 100' , order_by = ' TxnDate DESC' , qb = client)
210+
211+ # Order customers by FamilyName then by GivenName
212+ customers = Customer.all(order_by = ' FamilyName, GivenName' , qb = client)
213+
201214 Filtered list of objects with paging:
202215
203216.. code-block :: python
@@ -217,6 +230,12 @@ List with custom Where Clause (do not include the ``"WHERE"``):
217230
218231 customers = Customer.where(" Active = True AND CompanyName LIKE 'S%'" , qb = client)
219232
233+ List with custom Where and ordering:
234+
235+ .. code-block :: python
236+
237+ customers = Customer.where(" Active = True AND CompanyName LIKE 'S%'" , order_by = ' DisplayName' , qb = client)
238+
220239 List with custom Where Clause and paging:
221240
222241.. code-block :: python
@@ -443,4 +462,4 @@ on Python 2.
443462.. |Coverage Status | image :: https://coveralls.io/repos/sidecars/python-quickbooks/badge.svg?branch=master&service=github
444463 :target: https://coveralls.io/github/sidecars/python-quickbooks?branch=master
445464
446- .. _OAuth 1.0 vs. OAuth 2.0 : https://developer.intuit.com/docs/0100_quickbooks_online/0100_essentials/000500_authentication_and_authorization/0010_oauth_1.0a_vs_oauth_2.0_apps
465+ .. _OAuth 1.0 vs. OAuth 2.0 : https://developer.intuit.com/docs/0100_quickbooks_online/0100_essentials/000500_authentication_and_authorization/0010_oauth_1.0a_vs_oauth_2.0_apps
0 commit comments