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

23 lines
790 B
Python

from django.views.generic import ListView
from backoffice.mixins import BackofficeCRUDMixin, BackofficeHtmxMixin
from shop.models import Tax
SECTION = 'taxes'
class TaxListView(BackofficeCRUDMixin, BackofficeHtmxMixin, ListView):
model = Tax
permission_required = 'shop.view_tax'
section = SECTION
template_name = 'backoffice/generic/list.html'
fragment_template_name = 'backoffice/generic/_list_fragment.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({'title': 'Impuestos', 'columns': [('Código', 'code'), ('Valor (%)', 'value')]})
return context
# CRUD pendiente: replicar ProductCategoryCreateView/UpdateView/DeleteView de
# backoffice/views/products.py sobre el modelo Tax.