expephalon/core/views/backend/quotes.py

31 lines
1.1 KiB
Python
Raw Normal View History

from django.conf import settings
from django.urls import reverse_lazy
from core.models.quotes import QuoteItem, Quote
from core.views.backend.generic import BackendListView, BackendUpdateView, BackendDeleteView, BackendCreateView
class QuoteListView(BackendListView):
template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/index.html"
model = Quote
title = "Quotes"
class QuoteEditView(BackendUpdateView):
template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/update.html"
model = Quote
success_url = reverse_lazy("quotes")
fields = ["client", "brand", "number", "created", "expiry", "currency"]
title = "Edit Quote"
class QuoteDeleteView(BackendDeleteView):
template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/delete.html"
model = Quote
success_url = reverse_lazy("quotes")
title = "Delete Quote"
class QuoteCreateView(BackendCreateView):
template_name = f"{settings.EXPEPHALON_BACKEND}/quotes/create.html"
model = Quote
success_url = reverse_lazy("quotes")
fields = ["client", "brand", "number", "created", "expiry", "currency"]
title = "Create Quote"