fisk/core/views/ordersettings.py

38 lines
1022 B
Python

from django.contrib.auth.mixins import LoginRequiredMixin
from mixins.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
from core.forms import OrderSettingsForm
from core.models import OrderSettings
from core.util import logs
log = logs.get_logger(__name__)
class OrderSettingsList(LoginRequiredMixin, ObjectList):
list_template = "partials/ordersettings-list.html"
model = OrderSettings
page_title = "List of order settings. Linked to strategies."
list_url_name = "ordersettings"
list_url_args = ["type"]
submit_url_name = "ordersettings_create"
class OrderSettingsCreate(LoginRequiredMixin, ObjectCreate):
model = OrderSettings
form_class = OrderSettingsForm
submit_url_name = "ordersettings_create"
class OrderSettingsUpdate(LoginRequiredMixin, ObjectUpdate):
model = OrderSettings
form_class = OrderSettingsForm
submit_url_name = "ordersettings_update"
class OrderSettingsDelete(LoginRequiredMixin, ObjectDelete):
model = OrderSettings