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.