首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Django学校的模型设计中寻找输入

在Django学校的模型设计中寻找输入
EN

Stack Overflow用户
提问于 2008-12-05 19:13:41
回答 7查看 2.6K关注 0票数 2

今天,我开始了一个小项目,创建一个基于Django的学校管理程序。我目前正在设计模型和它们对应的关系。作为Django和一般关系数据库的新手,我想要一些意见。

在我向您展示当前的模型布局之前,您需要了解程序的用途。请记住,我的目标是使该软件既可用于单个学校,也可用于整个学校系统。

特性:-创建多所学校

  • 跟踪每个学校的学生人数
  • 跟踪学生统计数据、家长联系信息等。
  • 等级tracking
  • Generate纪律记录。
  • 费用计划和付款计划报告(学生活动、学生成绩单、班级进度、按人口统计划分的进度、付款报告、按学生班级和人口统计划分的纪律报告)

--向家长发送自动PDF报告电子邮件,以查看学生报告。

考虑到这些特性需求,下面是我当前拥有的模型布局:

代码语言:javascript
运行
复制
* 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

EN

回答 7

Stack Overflow用户

发布于 2008-12-05 19:51:46

快速浏览一下,我认为这是相当全面的。也许您应该允许在一门课程上有多个教师,并允许家长和学生之间重复使用地址/位置。

一般来说,我会说你应该开始实现,然后你会发现你需要改进的地方。

票数 1
EN

Stack Overflow用户

发布于 2008-12-05 21:41:53

一些可能的问题:

对于location对象,如果将来需要保存某个人的家庭地址、工作地址等,该怎么办?相同的电子邮件地址和电话号码-我会有电话号码是他们自己的对象。

在address对象上包含一个Address_3。

票数 1
EN

Stack Overflow用户

发布于 2008-12-05 20:16:54

看起来是个有趣的项目。请注意,Django具有比SQL更高级的类型,因此您可以使用诸如电子邮件地址类型之类的类型。

如果你打算以GAE为目标,你应该找到一个同样丰富的set of model types

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/344826

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档