summaryrefslogtreecommitdiff
path: root/app/trading/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/trading/admin.py')
-rw-r--r--app/trading/admin.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/app/trading/admin.py b/app/trading/admin.py
index 2e4e05c..338c924 100644
--- a/app/trading/admin.py
+++ b/app/trading/admin.py
@@ -1,6 +1,6 @@
from django.contrib import admin
from django.db import models
-from .models import TradeJrnl, LuxOptionsTrade, LuxTrade
+from .models import TradeJrnl, LuxOptionsTrade, LuxTrade, LuxOptionPurchase, LuxOptionContact
from utils.widgets import AdminImageWidget, LGEntryForm
@@ -34,3 +34,26 @@ class LuxTradeAdmin(admin.ModelAdmin):
"all": ("my_styles.css",)
}
+
+class LuxOptionContactInline(admin.StackedInline):
+ model = LuxOptionContact
+ extra = 0
+ fieldsets = (
+ (None, {
+ 'fields': (
+ 'contract_open_price',
+ 'contract_close_price'
+ )
+ }),
+ )
+
+
+@admin.register(LuxOptionPurchase)
+class LuxOptionPurchaseAdmin(admin.ModelAdmin):
+ list_display = ('symbol',)
+ inlines = [LuxOptionContactInline,]
+ class Media:
+ js = ('image-loader.js', 'next-prev-links.js')
+ css = {
+ "all": ("my_styles.css",)
+ }