From 2163702608184beaeb944a03a32ca409240a3cc5 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 22 Jul 2021 13:58:17 -0400 Subject: trad: small improvement to viewing and editing trades --- app/trading/models.py | 2 +- app/trading/templates/trading/list.html | 28 +++------------------------- app/trading/views.py | 1 + 3 files changed, 5 insertions(+), 26 deletions(-) (limited to 'app/trading') diff --git a/app/trading/models.py b/app/trading/models.py index 40762db..63febc2 100644 --- a/app/trading/models.py +++ b/app/trading/models.py @@ -129,7 +129,7 @@ class LuxTrade(models.Model): pl = models.FloatField(null=True) class Meta: - ordering = ('-open_date',) + ordering = ('status', '-open_date',) get_latest_by = 'open_date' def __str__(self): diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html index 7694583..f689d9d 100644 --- a/app/trading/templates/trading/list.html +++ b/app/trading/templates/trading/list.html @@ -1,6 +1,6 @@ {% extends 'trading/base.html' %} {% block content %} -

Current Trades

+

Stock Trades

@@ -44,29 +44,8 @@ {% endfor %} -
- -

Watching

- - - - - - - - - - - - - - - - - - {% for object in watch_trades %} - + @@ -94,8 +73,7 @@ {% endfor %}
SymbolOpen DateEntry PriceStopTargetSharesTotal Invested$ at Risk$ Goal% GoalRisk/RewardPrice CalcNotes
{{object.symbol}} {{object.date|date:"m-d-Y"}} ${{object.entry_price}}
- -

Current Options Trades

+

Options Trades

diff --git a/app/trading/views.py b/app/trading/views.py index d9d8f45..737dfb5 100644 --- a/app/trading/views.py +++ b/app/trading/views.py @@ -52,6 +52,7 @@ class LuxOptionsTradeDetailView(UpdateView): 'contract_price', 'number_contracts', 'delta' + 'notes' ] template_name = 'trading/update_options_form.html' success_url = '/trading/' -- cgit v1.2.3-70-g09d2