Chapter 5. Using Data from the Database in Views
What You’ll Learn in This Hour
- How to add objects to the SQL database
- How to access objects in the SQL database
- How to modify objects and update the SQL database
- How to perform complex queries on the SQL database
- How to apply data from the database in views
Django provides a valuable database-abstraction application programming interface (API) that allows you to create, retrieve, update, and delete objects in the database using Python code rather than SQL requests.
The database-abstraction API is automatically added to the models you create in the models.py
file. As you will see in the following sections, you can access the API methods used to create, modify, and query objects in the SQL database ...
Get Sams Teach Yourself Django in 24 Hours 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.