Implement viewing open positions

This commit is contained in:
2022-10-22 00:15:27 +01:00
parent 572b839c2c
commit 30d516ebf9
8 changed files with 81 additions and 72 deletions

View File

@@ -18,6 +18,7 @@ def get_accounts(user):
accounts = Account.objects.filter(user=user)
return accounts
class AccountInfo(LoginRequiredMixin, View):
VIEWABLE_FIELDS_MODEL = ["name", "exchange", "api_key", "sandbox"]
allowed_types = ["modal", "widget", "window", "page"]
@@ -46,7 +47,9 @@ class AccountInfo(LoginRequiredMixin, View):
live_info = dict(account.get_account())
account_info = account.__dict__
account_info = {k:v for k,v in account_info.items() if k in self.VIEWABLE_FIELDS_MODEL}
account_info = {
k: v for k, v in account_info.items() if k in self.VIEWABLE_FIELDS_MODEL
}
if type == "page":
type = "modal"
@@ -61,6 +64,7 @@ class AccountInfo(LoginRequiredMixin, View):
return render(request, template_name, context)
class Accounts(LoginRequiredMixin, View):
allowed_types = ["modal", "widget", "window", "page"]
window_content = "window-content/accounts.html"