Update tables when objects are changed
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user