· app:project
1. 编写Model模型
Project
| name | group | company | created | started | is_finished | finished | is_ended | ended |
---|
label | 项目名称 | 部门 | 甲方 | 创建时间 | 开始时间 | 是否完成 | 完成时间 | 是否结束 | 结束时间 |
field | CharField | ForeignKey | ForeignKey | DateTimeField | DateTimeField | BooleanField | DateTimeField | BooleanField | DateTimeField |
default | | | | | null | False | null | False | null |
验证 | mlen=50 | CASCADE | CASCADE | auto_now_add | blank=True,null=True | | blank=True,null=True | | blank=True,null=True |
外键 | | Group | Company | | | | --- | | --- |
Meta: ordering = ('-created',)
Company
--- | name | phone | address |
---|
label | 单位名称 | 电话号码 | 地址 |
field | CharField | CharField | TextField |
default | --- | --- | --- |
验证 | mlen=100 | mlen=20,blank=True | mlen=200,blank=True |
Customer
--- | name | phone | address | address |
---|
label | 姓名 | 单位 | 电话号码 | 电话号码 |
field | CharField | ForeignKey | CharField | CharField |
default | --- | --- | --- | --- |
验证 | mlen=20 | CASCADE | blank=True | blank=True |
外键 | | Company | | | | | |
2. 编写View视图