Update tables when objects are changed

This commit is contained in:
2022-10-29 14:05:01 +01:00
parent c685b6d25f
commit 6902665ffb
10 changed files with 160 additions and 14 deletions

View File

@@ -12,6 +12,7 @@ class TradeList(LoginRequiredMixin, ObjectList):
list_template = "partials/trade-list.html"
model = Trade
context_object_name = "trades"
context_object_name_singular = "trade"
title = "Trades"
title_singular = "Trade"
page_title = (
@@ -19,6 +20,9 @@ class TradeList(LoginRequiredMixin, ObjectList):
)
page_subtitle = "Trades deleted here will not be closed on the exchange."
list_url_name = "trades"
list_url_args = ["type"]
submit_url_name = "trade_create"
@@ -26,6 +30,11 @@ class TradeCreate(LoginRequiredMixin, ObjectCreate):
model = Trade
form_class = TradeForm
context_object_name = "trades"
context_object_name_singular = "trade"
list_url_name = "trades"
list_url_args = ["type"]
submit_url_name = "trade_create"
@@ -33,8 +42,18 @@ class TradeUpdate(LoginRequiredMixin, ObjectUpdate):
model = Trade
form_class = TradeForm
context_object_name = "trades"
context_object_name_singular = "trade"
list_url_name = "trades"
list_url_args = ["type"]
submit_url_name = "trade_update"
class TradeDelete(LoginRequiredMixin, ObjectDelete):
model = Trade
context_object_name = "trades"
context_object_name_singular = "trade"
list_url_name = "trades"
list_url_args = ["type"]