Skip to Content
Hands-On RESTful Python Web Services - Second Edition
book

Hands-On RESTful Python Web Services - Second Edition

by Gastón C. Hillar
December 2018
Intermediate to advanced
500 pages
12h 33m
English
Packt Publishing
Content preview from Hands-On RESTful Python Web Services - Second Edition

Understanding filtering, searching, and ordering classes

In the previous chapter, we took advantage of the pagination features available in Django REST Framework to specify how we wanted large results sets to be split into individual pages of data. However, we have always been working with the entire queryset as the result set; that is, we didn't apply any filter.

Django REST Framework makes it easy to customize filtering, searching, and sorting capabilities for the views we have already coded.

Open the settings.py file in the games_service/games_service folder. Add the following highlighted lines after the first line that declares the dictionary named REST_FRAMEWORK to add the new 'DEFAULT_FILTER_BACKENDS' setting key. Don't remove the lines ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building RESTful Python Web Services

Building RESTful Python Web Services

Gastón C. Hillar
Python Command Line Tools

Python Command Line Tools

Alfredo Deza, Noah Gift

Publisher Resources

ISBN: 9781789532227Supplemental Content