Django model (1), Django model (
Models in Django (1)
1. Basic Development Process
1. Configure the database
2. Define model class: A Model class corresponds to a data table in the database.
3. Generate a migration File
4. Execute the migration file generation data table
5. add, delete, modify, and query models
The above content is detailed in the basic process for creating Django in my blog. I will not go into details here. Http://www.cnblogs.com/xshan/p/8319076.html)
Ii. ORM
1. Overview
Converts an object to an SQL statement, and then uses the data API to execute the SQL statement and obtain the execution result. ORM indicates object-relationship- ing.
2. Functions
A. Generate the table structure based on the object type
B. Convert objects and lists into SQL statements.
C. Convert the SQL statement query results to objects and lists.
3. Advantages
This greatly reduces the workload of developers and does not need to modify the code due to database changes.