Implement CRUD for accounts and trades

This commit is contained in:
2022-10-17 18:56:16 +01:00
parent 7779cb8d0e
commit 2bafdf0910
18 changed files with 802 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.forms import ModelForm
from .models import Hook, User
from .models import Account, Hook, Trade, User
# Create your forms here.
@@ -42,3 +42,27 @@ class HookForm(ModelForm):
"name",
"hook",
)
class AccountForm(ModelForm):
class Meta:
model = Account
fields = (
"exchange",
"api_key",
"api_secret",
)
class TradeForm(ModelForm):
class Meta:
model = Trade
fields = (
"account",
"symbol",
"type",
"amount",
"price",
"stop_loss",
"take_profit",
)