Pull object names from model definitions in CRUD views
This commit is contained in:
@@ -14,10 +14,6 @@ log = logs.get_logger(__name__)
|
||||
class StrategyList(LoginRequiredMixin, ObjectList):
|
||||
list_template = "partials/strategy-list.html"
|
||||
model = Strategy
|
||||
context_object_name = "strategies"
|
||||
context_object_name_singular = "strategy"
|
||||
title = "Strategies"
|
||||
title_singular = "Strategy"
|
||||
page_title = "List of strategies"
|
||||
|
||||
list_url_name = "strategies"
|
||||
@@ -29,9 +25,6 @@ class StrategyList(LoginRequiredMixin, ObjectList):
|
||||
class StrategyCreate(LoginRequiredMixin, ObjectCreate):
|
||||
model = Strategy
|
||||
form_class = StrategyForm
|
||||
context_object_name = "strategies"
|
||||
context_object_name_singular = "strategy"
|
||||
|
||||
list_url_name = "strategies"
|
||||
list_url_args = ["type"]
|
||||
|
||||
@@ -41,8 +34,6 @@ class StrategyCreate(LoginRequiredMixin, ObjectCreate):
|
||||
class StrategyUpdate(LoginRequiredMixin, ObjectUpdate):
|
||||
model = Strategy
|
||||
form_class = StrategyForm
|
||||
context_object_name = "strategies"
|
||||
context_object_name_singular = "strategy"
|
||||
|
||||
list_url_name = "strategies"
|
||||
list_url_args = ["type"]
|
||||
@@ -52,8 +43,6 @@ class StrategyUpdate(LoginRequiredMixin, ObjectUpdate):
|
||||
|
||||
class StrategyDelete(LoginRequiredMixin, ObjectDelete):
|
||||
model = Strategy
|
||||
context_object_name = "strategies"
|
||||
context_object_name_singular = "strategy"
|
||||
|
||||
list_url_name = "strategies"
|
||||
list_url_args = ["type"]
|
||||
|
||||
Reference in New Issue
Block a user