Files
shoppy/backoffice/views/payments.py
T
pablo 2a9407e676
CI / ci (ubuntu-24.04, 3.13) (push) Has been cancelled
feat: backoffice setup
2026-07-23 13:31:53 +02:00

32 lines
962 B
Python

from django.views.generic import ListView
from backoffice.mixins import BackofficeCRUDMixin, BackofficeHtmxMixin
from shop.models import Payment
SECTION = 'payments'
class PaymentListView(BackofficeCRUDMixin, BackofficeHtmxMixin, ListView):
model = Payment
permission_required = 'shop.view_payment'
section = SECTION
paginate_by = 20
template_name = 'backoffice/generic/list.html'
fragment_template_name = 'backoffice/generic/_list_fragment.html'
ordering = '-creation_date'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update(
{
'title': 'Pagos',
'columns': [
('Fecha', 'creation_date'),
('Pedido', 'order.code'),
('Importe', 'amount'),
('Método', 'get_method_display'),
],
}
)
return context