summaryrefslogtreecommitdiff
path: root/app/trading
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2021-07-15 15:34:55 -0400
committerluxagraf <sng@luxagraf.net>2021-07-15 15:34:55 -0400
commitb86864ae1e2c78adff3d982c7687124213bd878f (patch)
tree98a79f678c56bf38fe0c94accf18034ad6fafc84 /app/trading
parentd771469e7b37c9de9ed93e156bc4615180c8d413 (diff)
trad: added a field to track wanderer trades
Diffstat (limited to 'app/trading')
-rw-r--r--app/trading/models.py1
-rw-r--r--app/trading/templates/trading/list.html6
-rw-r--r--app/trading/views.py4
3 files changed, 6 insertions, 5 deletions
diff --git a/app/trading/models.py b/app/trading/models.py
index a8c18a8..edfc0c2 100644
--- a/app/trading/models.py
+++ b/app/trading/models.py
@@ -102,6 +102,7 @@ class LuxTrade(models.Model):
)
status = models.IntegerField(choices=STATUS, default=2)
notes = models.TextField(null=True, blank=True)
+ is_wanderer = models.BooleanField(default=True)
def __str__(self):
return str(self.symbol)
diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html
index 9093d07..ef496cd 100644
--- a/app/trading/templates/trading/list.html
+++ b/app/trading/templates/trading/list.html
@@ -3,7 +3,7 @@
<h3>Current Trades</h3>
<table>
<thead>
- <tr>
+ <tr {%if object.is_wanderer %}class="wanderer-trade"{% endif %}>
<th>Symbol</th>
<th>Open Date</th>
<th>Entry Price</th>
@@ -39,7 +39,7 @@
<h3>Watching </h3>
<table>
<thead>
- <tr>
+ <tr {%if object.is_wanderer %}class="wanderer-trade"{% endif %}>
<th>Symbol</th>
<th>Open Date</th>
<th>Entry Price</th>
@@ -90,7 +90,7 @@
</tr>
</thead>
{% for object in object_list %}
- <tr>
+ <tr {%if object.is_wanderer %}class="wanderer-trade"{% endif %}>
<td><a href="{{object.get_absolute_url}}">{{object.date|date:"m-d-Y"}}</a></td>
<td>{{object.symbol}}</td>
<td>${{object.entry_price}}</td>
diff --git a/app/trading/views.py b/app/trading/views.py
index 1b07852..a32d571 100644
--- a/app/trading/views.py
+++ b/app/trading/views.py
@@ -16,13 +16,13 @@ class OptionsTradeResultsView(PaginatedListView):
class TradeModelFormView(CreateView):
model = LuxTrade
- fields = ['symbol', 'status', 'entry_price', 'stop_price', 'target_price', 'shares']
+ fields = ['symbol', 'status', 'entry_price', 'stop_price', 'target_price', 'shares', 'is_wanderer']
success_url = '/trading/'
template_name = 'trading/create_form.html'
class LuxTradeDetailView(UpdateView):
model = LuxTrade
- fields = ['symbol', 'status', 'entry_price', 'stop_price', 'target_price', 'shares', 'close_price', 'notes']
+ fields = ['symbol', 'status', 'entry_price', 'stop_price', 'target_price', 'shares', 'close_price', 'notes', 'is_wanderer']
template_name = 'trading/update_form.html'
success_url = '/trading/'