Coursera Django Module 2 ORM Flashcards
What are the two paradigms that model data differently?
The Object-Oriented Programming (OOP) paradigm and the SQL paradigm model data differently.
What is Object Relational Mapping (ORM)?
Object Relational Mapping (ORM) is a technique that bridges the gap between Object-Oriented Programming (OOP) and SQL by mapping and transferring data stored in a relational database as rows into objects or objects into rows.
What does ORM allow developers to do?
ORM allows developers to use Object-Oriented Programming (OOP) to query and manipulate data by transferring objects into rows and rows into objects.
What is Django ORM?
Django ORM is a Python ORM component that belongs to the Django web application framework.
How does Django ORM speed up database development?
Django ORM speeds up database development by defining maps to a database table for each Django model, automatically creating tables once models and fields are defined.
What does each Django field map to?
Each Django field maps to a column type in the database.
What operations can Django APIs perform on database objects?
Django APIs can perform Create, Read, Update, and Delete (CRUD) operations on database objects.
How do you insert an object into the database in Django?
To insert an object into the database in Django, you create an object and call the model’s save method to insert it into the database as a record.
How do you read objects using Django Model API?
To read objects using Django Model API, you must construct a QuerySet using a Manager on your model class.
What are the ways to update database records in Django?
There are several ways to update database records in Django by updating objects.
How do you delete records in a database using Django ORM?
To delete records in a database using Django ORM, you call the Delete method on a model object or query set.