今天我开始了一个小项目来创建一个基于 Django 的学校管理程序。我目前正在设计模型及其对应关系。作为 Django 和一般关系数据库的新手,我想要一些输入。
在我向您展示当前的模型布局之前,您需要了解该程序的用途。请记住,我的目标是让各个学校和整个学校系统都可以使用该软件。
特点: - 创建多所学校
- 跟踪每所学校的学生人数
- 跟踪学生人口统计数据、家长联系信息等
- 成绩册
- 成绩单
- 跟踪纪律记录。
- 费用表和付款跟踪
- 生成报告(学生活动、学生成绩单、班级进度、人口统计进度、付款报告、学生班级和人口统计纪律报告)
- 自动 PDF 报告电子邮件发送给家长以获取学生报告。
鉴于这些功能要求,这是我目前拥有的模型布局:
* Person
o ID: char or int
o FirstName: char
o MiddleName: char
o FamilyName: char
o Sex: multiple choice
o Ethnicity: multiple choice
o BirthDate: date
o Email: char
o HomePhone: char
o WordPhone: char
o CellPhone: char
o Address: one-to-one with Location
* Student (inherent Person)
o Classes: one-to-many with Class
o Parents: one-to-many with Parent
o Account: one-to-one with PaymentSchedule
o Tasks: one-to-many with Tasks
o Diciplin: one-to-many with Discipline
* Parent (inherent Person)
o Children: one-to-many with Student
* Teacher (inherent Person)
o Classes: one-to-many with Class
* Location
o Address: char
o Address2: char
o Address3: char
o City: char
o StateProvince: char
o PostalCode: char
o Country: multiple choice
* Course
o Name: char
o Description: text field
o Grade: int
* Class
o School: one-to-one with School
o Course: one-to-one with Course
o Teacher: one-to-one with Teacher
o Students: one-to-many with Student
* School
o ID: char or int
o Name: char
o Location: one-to-one with location
* Tasks
o ID: auto increment
o Type: multiple choice (assignment, test, etc.)
o DateAssigned: date
o DateCompleted: date
o Score: real
o Weight: real
o Class: one-to-one with class
o Student: one-to-one with Student
* Discipline
o ID: auto-increment
o Discription: text-field
o Reaction: text-field
o Students: one-to-many with Student
* PaymentSchedule
o ID: auto-increment
o YearlyCost: real
o PaymentSchedule: multiple choice
o ScholarshipType: multiple choice, None if N/A
o ScholarshipAmount: real, 0 if N/A
o Transactions: one-to-many with Payments
* Payments
o auto-increment
o Amount: real
o Date: date
如果您对如何改进这一点有任何想法,我很乐意为他们服务!
更新
我已经编写了最初的 models.py 代码,这可能需要很多的爱。如果您想看一下,甚至想加入该项目,请查看链接。
http://bazaar.launchpad.net/~djangoschools/djangoschools/trunk/files