Test your knowledge

Let's see whether you can answer the following questions correctly:

  1. The django_filters.rest_framework.DjangoFilterBackend class provides:
    1. Control on how the results are ordered with a single query parameter
    2. Single query parameter-based searching capabilities, based on the Django admin's search function
    3. Field filtering capabilities
  2. The rest_framework.filters.SearchFilter class provides:
    1. Control on how the results are ordered with a single query parameter
    2. Single query parameter-based searching capabilities, based on the Django admin's search function
    3. Field filtering capabilities
  3. If we want to create a unique constraint, what must be added to a models.CharField initializer as one of the named arguments?
    1. unique=True
    2. unique_constraint=True
    3. force_unique=True
  4. Which of the following class attributes specifies a tuple of strings whose values indicate the field names that we want to be able to filter against in a class-based view that inherits from generics.ListCreateAPIView:
    1. filters
    2. filtering_fields
    3. filter_fields
  5. Which of the following class attributes specifies a tuple of strings whose values indicate the field names that the HTTP request can specify to sort the results in a class-based view that inherits from generics.ListCreateAPIView:
    1. order_by
    2. ordering_fields
    3. order_fields

 

The rights answers are included in the AppendixSolutions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset