From e3d57c9aa8aa6010c66ac3eb8af8e73e038409d1 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 13 Nov 2022 13:22:31 +0000 Subject: [PATCH] Fix HTMX widgets and tweak display of some titles --- core/models.py | 3 +++ core/views/__init__.py | 3 ++- core/views/positions.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/models.py b/core/models.py index deb6889..10e893d 100644 --- a/core/models.py +++ b/core/models.py @@ -220,6 +220,9 @@ class Strategy(models.Model): price_slippage_percent = models.FloatField(default=2.5) trade_size_percent = models.FloatField(default=0.5) + class Meta: + verbose_name_plural = "strategies" + def __str__(self): return self.name diff --git a/core/views/__init__.py b/core/views/__init__.py index e15a380..a74bf25 100644 --- a/core/views/__init__.py +++ b/core/views/__init__.py @@ -90,7 +90,8 @@ class ObjectList(ObjectNameMixin, ListView): # Return partials for HTMX if self.request.htmx: - self.template_name = self.list_template + # self.template_name = self.list_template + context["window_content"] = self.list_template return self.render_to_response(context) diff --git a/core/views/positions.py b/core/views/positions.py index 7bdfdf0..0fc858c 100644 --- a/core/views/positions.py +++ b/core/views/positions.py @@ -43,7 +43,7 @@ class Positions(LoginRequiredMixin, View): if type == "page": type = "modal" context = { - "title": f"Hooks ({type})", + "title": f"Positions ({type})", "unique": unique, "window_content": self.window_content, "list_template": self.list_template, @@ -75,7 +75,7 @@ class PositionAction(LoginRequiredMixin, View): if type == "page": type = "modal" context = { - "title": f"Hooks ({type})", + "title": f"Position info ({type})", "unique": unique, "window_content": self.window_content, "type": type,