Implement configuration of trading times
This commit is contained in:
47
core/views/limits.py
Normal file
47
core/views/limits.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
||||
from core.forms import TradingTimeForm
|
||||
from core.models import TradingTime
|
||||
from core.util import logs
|
||||
from core.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
||||
|
||||
log = logs.get_logger(__name__)
|
||||
|
||||
|
||||
class TradingTimeList(LoginRequiredMixin, ObjectList):
|
||||
list_template = "partials/trading-time-list.html"
|
||||
model = TradingTime
|
||||
page_title = "List of allowed trading times. Used as options for a strategy."
|
||||
page_subtitle = "Add times here in order to permit trading."
|
||||
|
||||
list_url_name = "tradingtimes"
|
||||
list_url_args = ["type"]
|
||||
|
||||
submit_url_name = "tradingtime_create"
|
||||
|
||||
|
||||
class TradingTimeCreate(LoginRequiredMixin, ObjectCreate):
|
||||
model = TradingTime
|
||||
form_class = TradingTimeForm
|
||||
|
||||
list_url_name = "tradingtimes"
|
||||
list_url_args = ["type"]
|
||||
|
||||
submit_url_name = "tradingtime_create"
|
||||
|
||||
|
||||
class TradingTimeUpdate(LoginRequiredMixin, ObjectUpdate):
|
||||
model = TradingTime
|
||||
form_class = TradingTimeForm
|
||||
|
||||
list_url_name = "tradingtimes"
|
||||
list_url_args = ["type"]
|
||||
|
||||
submit_url_name = "tradingtime_update"
|
||||
|
||||
|
||||
class TradingTimeDelete(LoginRequiredMixin, ObjectDelete):
|
||||
model = TradingTime
|
||||
|
||||
list_url_name = "tradingtimes"
|
||||
list_url_args = ["type"]
|
||||
Reference in New Issue
Block a user