Simplify DB object management with Django CRUD helpers
This commit is contained in:
@@ -37,7 +37,10 @@ def get_positions(user, account_id=None):
|
||||
|
||||
class Positions(LoginRequiredMixin, View):
|
||||
allowed_types = ["modal", "widget", "window", "page"]
|
||||
window_content = "window-content/positions.html"
|
||||
window_content = "window-content/objects.html"
|
||||
list_template = "partials/position-list.html"
|
||||
page_title = "Live positions from all exchanges"
|
||||
page_subtitle = "Manual trades are editable under 'Bot Trades' tab."
|
||||
|
||||
async def get(self, request, type, account_id=None):
|
||||
if type not in self.allowed_types:
|
||||
@@ -51,8 +54,11 @@ class Positions(LoginRequiredMixin, View):
|
||||
"title": f"Hooks ({type})",
|
||||
"unique": unique,
|
||||
"window_content": self.window_content,
|
||||
"list_template": self.list_template,
|
||||
"items": items,
|
||||
"type": type,
|
||||
"page_title": self.page_title,
|
||||
"page_subtitle": self.page_subtitle,
|
||||
}
|
||||
return render(request, template_name, context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user