Django 餐點訂購系統 ===    # 餐點訂購系統 [TOC] ## 環境設定 1. 語言:Python3.5 2. 框架:Django 3. 資料庫:Sqlite # 功能要求 1. 產品基本資訊管理 2. 訂購資訊管理 3. 顧客預約、取消、付款取貨、退貨管理 4. 查詢訂單訊息、預約狀況、顧客資訊、計算訂單總和 5. 統計每周、每月、每年營收狀況 ## 功能分析 ### 系統主要功能圖 ```graphviz digraph hierarchy { nodesep=.5 // increases the separation between nodes node [color=Black,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=Red, style=solid] //All the lines look like this 訂購系統->{用戶介面 管理介面} 用戶介面->{用戶資訊 訂 查 退} 管理介面->{訂單資訊 客戶資訊 財務資訊} } ``` #### 用戶介面 * 個人資訊:用戶查看個人訂單資訊 * 查詢:查詢訂單資訊 * 排序:對訂單做排序篩選 * 訂購:訂購時紀錄客戶及訂單資訊並更新資料庫 * 取消:取消訂單需求時處理並更新資料庫 * 幫助:用戶介面教學文件 * 退出:退出介面 #### 管理介面 * 訂單資訊:對訂單做CRUD * 用戶資訊:對用戶做CRUD * 財務資訊:統計每周、每月、每年營收情況 * 幫助:管理介面教學文件 * 退出:退出介面 ### 數據流程 數據流程圖: ```sequence ``` ### 資料表 - 商品資訊 - id 可不用會自動生成 | pk | auto| Field | Datatype | size | | --- | --- | ----- | -------- | ---- | | [0] | [0] | pid | nvarchar | 100 | | - | - | pname | nvarchar | 100 | | - | - | price | real | - | - 訂單資訊表 | pk | auto| Field | Datatype | size | | --- | --- | ----- | -------- | ---- | | [0] | [0] | oid | nvarchar | 100 | | - | - | oname | nvarchar | 100 | | - | - | price | real | - | | - | - | qty | integer | - | | - | - | osum | real | - | | - | - | in_date | datetime| - | | - | - | remark| nvarchar | 255 | - 客戶資料表 | pk | auto| Field | Datatype | size | | --- | --- | ----- | -------- | ---- | | [0] | [0] | uid | nvarchar | 100 | | - | - | uname | nvarchar | 100 | | - | - | upassword | nvarchar | 100 | | - | - | uemail | nvarchar | 255 | | - | - | in_date | datetime | | | - | - | birth_date| datetime | | | - | - | remark | nvarchar | 255 | - 實體多對多關係 | key | Field | Datatype | | --- | ----- | -------- | | pk | oid | nvarchar | | fk | pid | nvarchar | | fk | uid | nvarchar | [sqlite datatype](https://www.sqlite.org/datatype3.html) ## 功能設計 ### 用戶模組 1. 訂購 2. 查詢 3. 修改 4. 刪除 5. 個人資料 ### 管理模組 1. 訂單資訊 model.py 中設定 ``` class ProductAdmin(admin.ModelAdmin): #顯示 list_display = ['title','price','remark','active','updated'] #查詢 search_fields = ['title','remark'] #修改 list_editable = ['price','active'] ``` [admin 設定](https://docs.djangoproject.com/en/3.0/ref/contrib/admin/) 3. 用戶資訊 4. 財務統計 # 介面設計 ## 起始頁面 ## 用戶介面 * 訂購 * 修改 * 刪除 ## 管理介面 * 登入 * 後台管理 [參考](https://github.com/buckyroberts/Viberr) ###### tags: `Django`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up