Pull object names from model definitions in CRUD views

This commit is contained in:
2022-11-04 07:20:42 +00:00
parent 0c52cbd0f8
commit d34ac39d68
10 changed files with 29 additions and 159 deletions

View File

@@ -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"]