
上QQ阅读APP看书,第一时间看更新
Test your knowledge
- In Django REST framework, serializers are:
- Mediators between the view functions and Python primitives
- Mediators between the URLs and view functions
- Mediators between the model instances and Python primitives
- If we want to create a simple Toy model that we will use to represent and persist toys in Django REST framework, we can create:
- A Toy class as a subclass of the djangorestframework.models.Model class
- A Toy class as a subclass of the django.db.models.Model class
- A Toy function in the restframeworkmodels.py file
- In Django REST framework, parsers and renderers:
- Handle as mediators between model instances and Python primitives
- Handle as mediators between Python primitives and HTTP requests and responses
- Handle as mediators between the view functions and Python primitives.
- Which of the following commands starts the Django shell?
- python manage.py shell
- python django.py shell
- django shell
- If we have a Django application named computers and a model called memory, what is the name of the table that Django's ORM will create to persist the model in the database?
- computers_memories
- memory_computers
- computers_memory
The rights answers are included in the Appendix, Solutions.