Closes #19891: Bulk operation jobs (#19897)

* Add background_job toggle to BulkEditForm

* Account for bug fix in v4.3.4

* Enable background jobs for bulk edit & bulk delete

* Move background_job field to a mixin

* Cosmetic improvements

* Misc cleanup

* Fix BackgroundJobMixin
This commit is contained in:
Jeremy Stretch
2025-07-18 09:24:38 -04:00
committed by GitHub
parent 7f2b744a53
commit cebc56e5cc
11 changed files with 121 additions and 31 deletions

View File

@@ -6,11 +6,20 @@ from django.core.validators import MaxValueValidator, MinValueValidator
from django.utils.translation import gettext_lazy as _
__all__ = (
'BackgroundJobMixin',
'CheckLastUpdatedMixin',
'DistanceValidationMixin',
)
class BackgroundJobMixin(forms.Form):
background_job = forms.BooleanField(
label=_('Background job'),
help_text=_("Execute this task via a background job"),
required=False,
)
class CheckLastUpdatedMixin(forms.Form):
"""
Checks whether the object being saved has been updated since the form was initialized. If so, validation fails.