How do you accept a
GET
,POST
andPUT
call to a function-based view using an API decorator?What are the benefits of using a serializer? Choose all that apply.
It can save data to a database
It can validate data
It helps to authenticate API calls
It can automatically convert data to JSON or XML
It can convert user input and map it to models
It can convert model instances to native Python data types
Which of the following are valid serializer classes in DRF? Choose all that apply.
RelationshipSerializer
Serializer
PrimaryKeySerializer
ModelSerializer
HyperLinkModelSerializer
You can access the data attribute of a serializer class at any time.
True
False
Which of the following renderers comes with DRF by default? Choose all that apply.
XML Renderer
YAML Renderer
JSON Renderer
HTML Renderer
Which of the following statement is true about DRF?
Learning DRF is tough
DRF is a standalone framework
DRF is built for API development
DRF doesn’t work with different database engines
Which of the following panels are available in the DDT or Django debug toolbar? Choose all that apply.
SQL
Throttle
Profiling
Headers
Network
To serialize a queryset that returns more than one item, which of the following arguments is necessary for the serializer class?
many=True
multiple_items=True
related=True
Which of the following statements are true about using renderers? Choose all that apply.
Renderers need an Accept header to work properly
You cannot use multiple renderers in a project
If no Accept header is present, DRF uses JSON renderer by default.
You cannot forcefully use a single renderer
Renderers can automatically convert the output
How do you display related model fields as hyperlinks? Choose all that apply.
Using
HyperlinkedModelSerializer
Using
HyperlinkedRelatedField
A ModelSerializer can do it automatically
Using
RelationshipSerializer