Improve order and order item admin views
This commit is contained in:
parent
f6753172ec
commit
7464ee4ea4
1 changed files with 11 additions and 4 deletions
15
app/admin.py
15
app/admin.py
|
@ -23,19 +23,26 @@ class UserAdminModel(ModelBaseView):
|
|||
|
||||
class OrderAdminModel(ModelBaseView):
|
||||
# pylint: disable=too-few-public-methods
|
||||
column_default_sort = ("starttime", True)
|
||||
column_list = ["starttime", "stoptime", "location_name", "location_id", "courier"]
|
||||
column_labels = {
|
||||
"starttime": "Start time", "stoptime": "Closing time",
|
||||
"location_name": "Location name", "location_id": "HLDS location ID",
|
||||
"courier": "Courier"}
|
||||
"starttime": "Start Time", "stoptime": "Closing Time",
|
||||
"location_id": "HLDS Location ID"}
|
||||
form_excluded_columns = ["items", "courier_id"]
|
||||
column_default_sort = ("starttime", True)
|
||||
can_delete = False
|
||||
|
||||
|
||||
class OrderItemAdminModel(ModelBaseView):
|
||||
# pylint: disable=too-few-public-methods
|
||||
column_default_sort = ("order_id", True)
|
||||
column_list = [
|
||||
"order_id", "order.location_name", "user_name", "user", "dish_name", "dish_id", "comment", "price", "paid",
|
||||
"hlds_data_version"
|
||||
]
|
||||
column_labels = {
|
||||
"order_id": "Order", "order.location_name": "Order's Location",
|
||||
"user_name": "Anon. User", "user_id": "Registered User",
|
||||
"hlds_data_version": "HLDS Data Version", "dish_id": "HLDS Dish ID"}
|
||||
|
||||
|
||||
def init_admin(app: Flask, database: SQLAlchemy) -> None:
|
||||
|
|
Loading…
Reference in a new issue