Adding TicketListView
This commit is contained in:
parent
539b3ee105
commit
700b876fd3
0
shop/templates/ticket_detail.html
Normal file
0
shop/templates/ticket_detail.html
Normal file
0
shop/templates/ticket_list.html
Normal file
0
shop/templates/ticket_list.html
Normal file
|
@ -20,6 +20,8 @@ urlpatterns = [
|
|||
|
||||
url(r'orders/(?P<pk>[0-9]+)/pay/banktransfer/$', BankTransferView.as_view(), name='bank_transfer'),
|
||||
|
||||
url(r'tickets/', TicketListView.as_view(), name='ticket_list'),
|
||||
|
||||
url(r'privacy-policy/', TemplateView.as_view(template_name='law/privacy_policy.html'), name='privacy-policy'),
|
||||
url(r'return-policy/', TemplateView.as_view(template_name='law/return_policy.html'), name='return-policy'),
|
||||
url(r'general-terms-and-conditions/', TemplateView.as_view(template_name='law/general_terms_and_conditions.html'), name='general-terms')
|
||||
|
|
|
@ -27,6 +27,7 @@ from shop.models import (
|
|||
EpayPayment,
|
||||
CoinifyAPIInvoice,
|
||||
CoinifyAPICallback,
|
||||
Ticket,
|
||||
)
|
||||
from .forms import AddToOrderForm
|
||||
from .epay import calculate_epay_hash, validate_epay_callback
|
||||
|
@ -474,3 +475,14 @@ class CoinifyThanksView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsureClos
|
|||
model = Order
|
||||
template_name = 'coinify_thanks.html'
|
||||
|
||||
|
||||
class TicketListView(LoginRequiredMixin, ListView):
|
||||
model = Ticket
|
||||
template_name = 'ticket_list.html'
|
||||
context_object_name = 'tickets'
|
||||
|
||||
def get_queryset(self):
|
||||
tickets = super(TicketListView, self).get_queryset()
|
||||
user = self.request.user
|
||||
return tickets.filter(order__user=user)
|
||||
|
||||
|
|
Loading…
Reference in a new issue