buttons in table footer

This commit is contained in:
2025-07-11 20:26:02 +03:00
parent d72cf0a0b3
commit d986fdf232
46 changed files with 1828 additions and 1720 deletions
+21
View File
@@ -0,0 +1,21 @@
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
class CRUDListViewMixin:
...
# def post(self, request, *args, **kwargs):
# if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
# object_id = request.POST.get('object_id')
# obj = get_object_or_404(self.model, id=object_id)
# return JsonResponse(self.get_object_data(obj))
# else:
# return self.handle_form_submission(request, *args, **kwargs)
# def get_object_data(self, obj):
# """Override this method in child views to specify which data to return"""
# raise NotImplementedError
#
# def handle_form_submission(self, request, *args, **kwargs):
# """Override this method in child views to handle form submission"""
# raise NotImplementedError