-
Structure
Use two apps
studentandstudent_classto manage related resources. -
Model
- StudentClass
id: primary key. updated_at: auto-saved, refer to the point in time the instance be updated. created_at: auto-saved, refer to the point in time the instance be created. grade: grade of the class. sequence_num: class number. - Student
id: primary key. updated_at: auto-saved, refer to the point in time the instance be updated. created_at: auto-saved, refer to the point in time the instance be created. name: student name. gender: student gender (M|F). age: student age. cls_id: a foreign key point to `Student`.
- StudentClass
-
FIELDS
specify
ordering_fields,search_fields,readonly_fieldsunderStudentViewSet -
REST API
For app
Student, I useModelViewSet, which provides several MixIns of REST methods.
AndModelSerializerat the same time, handling the fields as well as methodsupdate()andcreate().However, to meet the requirements of this assignment, I chose the standard way to perform app
StudentClass.
Under this condition, we have to deal with the basic REST api logic in ourViewSetclass.
Meanwhile, overrideupdate()andcreate()inSerializerclass. -
TEST
- Database migrations and model test under django admin page(using default database
sqlite) - REST api logic test, CRUD
- Database migrations and model test under django admin page(using default database
-
ACCOUNT
username: alan password: 123
-
Notifications
You must be signed in to change notification settings - Fork 0
AlanWing/student_management
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
A restful web application demo using DRF
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published