django-bulk-hooks 0.1.88__tar.gz → 0.1.89__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.
Potentially problematic release.
This version of django-bulk-hooks might be problematic. Click here for more details.
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/PKG-INFO +1 -1
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/engine.py +14 -15
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/pyproject.toml +1 -1
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/LICENSE +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/README.md +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/__init__.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/conditions.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/constants.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/context.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/decorators.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/enums.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/handler.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/manager.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/models.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/queryset.py +0 -0
- {django_bulk_hooks-0.1.88 → django_bulk_hooks-0.1.89}/django_bulk_hooks/registry.py +0 -0
|
@@ -52,20 +52,19 @@ def run(model_cls, event, new_instances, original_instances=None, ctx=None):
|
|
|
52
52
|
else:
|
|
53
53
|
handler_instance, func = _handler_cache[handler_key]
|
|
54
54
|
|
|
55
|
-
#
|
|
56
|
-
if
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
# For conditional hooks, filter instances first
|
|
61
|
-
to_process_new = []
|
|
62
|
-
to_process_old = []
|
|
55
|
+
# Filter instances based on condition
|
|
56
|
+
if condition:
|
|
57
|
+
to_process_new = []
|
|
58
|
+
to_process_old = []
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
for new, original in zip(new_instances, original_instances, strict=True):
|
|
61
|
+
if condition.check(new, original):
|
|
62
|
+
to_process_new.append(new)
|
|
63
|
+
to_process_old.append(original)
|
|
68
64
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
# Only call if we have matching instances
|
|
66
|
+
if to_process_new:
|
|
67
|
+
func(new_records=to_process_new, old_records=to_process_old if any(to_process_old) else None)
|
|
68
|
+
else:
|
|
69
|
+
# No condition, process all instances
|
|
70
|
+
func(new_records=new_instances, old_records=original_instances if any(original_instances) else None)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|