Test your knowledge

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

  1. Under the hood, the @api_view decorator is:
    1. A wrapper that converts a function-based view into a subclass of the rest_framework.views.APIView class
    2. A wrapper that converts a function-based view into a serializer
    3. A wrapper that converts a function-based view into a subclass of the rest_framework.views.api_view class

  1. The Serializer and ModelSerializer classes in Django REST Framework are similar to which of the following two classes in Django Web framework?
    1.  Form and ModelForm
    2. View and ModelView
    3. Controller and ModelController
  1. Which of the following classes is a read-write field that represents the target of the relationship by a unique slug attribute, that is, the description?
    1. SlugLinkedField
    2. HyperlinkedRelatedField
    3. SlugRelatedField
  1. Which of the following classes renders the URL for a related object?
    1. SlugLinkedField
    2. HyperlinkedRelatedField
    3. SlugRelatedField
  1. The browsable API is a feature included in Django REST Framework that:
    1. Generates human-friendly JSON output for each resource whenever the request specifies application/json as the value for the Content-type key in the request header
    2. Generates human-friendly HTML output for each resource whenever the request specifies text/html as the value for the Content-type key in the request header
    3. . Generates human-friendly HTML output for each resource whenever the request specifies application/json as the value for the Content-type key in the request header

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

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