Configuring filtering, searching, and ordering for views

Open the views.py file in the games_service/games folder. Add the following code after the last line that declares the imports, before the declaration of the UserList class. The code file for the sample is included in the restful_python_2_08_01 folder, in the Django01/games-service/games/views.py file:

from rest_framework import filters 
from django_filters import AllValuesFilter, DateTimeFilter, NumberFilter 
from django_filters.rest_framework import FilterSet 

Stay editing the views.py file in the games_service/games folder. Add the following highlighted lines to the EsrbRatingList class declared in the views.py file. Don't remove the existing lines for this class that isn't shown to ...

Get Hands-On RESTful Python Web Services - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.