django-filthyfields 2.0.1__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_filthyfields-2.0.1/src/django_filthyfields.egg-info → django_filthyfields-2.0.2}/PKG-INFO +1 -1
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/pyproject.toml +1 -1
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2/src/django_filthyfields.egg-info}/PKG-INFO +1 -1
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/filthyfields/filthyfields.py +8 -4
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/LICENSE +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/MANIFEST.in +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/README.md +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/setup.cfg +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/setup.py +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/django_filthyfields.egg-info/SOURCES.txt +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/django_filthyfields.egg-info/dependency_links.txt +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/django_filthyfields.egg-info/requires.txt +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/django_filthyfields.egg-info/top_level.txt +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/filthyfields/__init__.py +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/filthyfields/_descriptor.c +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/filthyfields/_descriptor.py +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/filthyfields/compare.py +0 -0
- {django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/filthyfields/py.typed +0 -0
|
@@ -447,17 +447,21 @@ class DirtyFieldsMixin(models.Model, metaclass=_DirtyMeta):
|
|
|
447
447
|
self.save(update_fields=list(dirty_fields))
|
|
448
448
|
|
|
449
449
|
|
|
450
|
-
def capture_dirty_state(instances: Iterable[DirtyFieldsMixin]) -> None:
|
|
451
|
-
"""Snapshot dirty state
|
|
450
|
+
def capture_dirty_state(instances: DirtyFieldsMixin | Iterable[DirtyFieldsMixin]) -> None:
|
|
451
|
+
"""Snapshot dirty state — call before ``bulk_update()`` so ``was_dirty()`` works after. Accepts a single instance or an iterable."""
|
|
452
|
+
if isinstance(instances, DirtyFieldsMixin):
|
|
453
|
+
instances = (instances,)
|
|
452
454
|
for instance in instances:
|
|
453
455
|
instance._dirty_capture_was_dirty()
|
|
454
456
|
|
|
455
457
|
|
|
456
458
|
def reset_dirty_state(
|
|
457
|
-
instances: Iterable[DirtyFieldsMixin],
|
|
459
|
+
instances: DirtyFieldsMixin | Iterable[DirtyFieldsMixin],
|
|
458
460
|
fields: Iterable[str] | None = None,
|
|
459
461
|
) -> None:
|
|
460
|
-
"""Clear dirty state
|
|
462
|
+
"""Clear dirty state — call after ``bulk_update()``. ``fields`` accepts name or attname. Accepts a single instance or an iterable."""
|
|
463
|
+
if isinstance(instances, DirtyFieldsMixin):
|
|
464
|
+
instances = (instances,)
|
|
461
465
|
field_list = list(fields) if fields is not None else None
|
|
462
466
|
for instance in instances:
|
|
463
467
|
instance._dirty_reset_state(fields=field_list)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_filthyfields-2.0.1 → django_filthyfields-2.0.2}/src/django_filthyfields.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|