django-bulk-hooks 0.1.243__tar.gz → 0.1.244__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.243 → django_bulk_hooks-0.1.244}/PKG-INFO +1 -1
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/queryset.py +9 -14
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/pyproject.toml +1 -1
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/LICENSE +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/README.md +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/__init__.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/conditions.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/constants.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/context.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/decorators.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/engine.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/enums.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/handler.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/manager.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/models.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/priority.py +0 -0
- {django_bulk_hooks-0.1.243 → django_bulk_hooks-0.1.244}/django_bulk_hooks/registry.py +0 -0
|
@@ -158,18 +158,20 @@ class HookQuerySetMixin:
|
|
|
158
158
|
else:
|
|
159
159
|
setattr(obj, field, value)
|
|
160
160
|
|
|
161
|
-
#
|
|
161
|
+
# Salesforce-style trigger behavior: Always run hooks, rely on Django's stack overflow protection
|
|
162
162
|
from django_bulk_hooks.context import get_bypass_hooks
|
|
163
163
|
|
|
164
164
|
current_bypass_hooks = get_bypass_hooks()
|
|
165
165
|
|
|
166
|
-
#
|
|
166
|
+
# Only skip hooks if explicitly bypassed (not for recursion prevention)
|
|
167
167
|
if current_bypass_hooks:
|
|
168
|
-
logger.debug("update:
|
|
168
|
+
logger.debug("update: hooks explicitly bypassed")
|
|
169
169
|
ctx = HookContext(model_cls, bypass_hooks=True)
|
|
170
170
|
else:
|
|
171
|
-
|
|
171
|
+
# Always run hooks - Django will handle stack overflow protection
|
|
172
|
+
logger.debug("update: running hooks with Salesforce-style behavior")
|
|
172
173
|
ctx = HookContext(model_cls, bypass_hooks=False)
|
|
174
|
+
|
|
173
175
|
# Run validation hooks first
|
|
174
176
|
engine.run(model_cls, VALIDATE_UPDATE, instances, originals, ctx=ctx)
|
|
175
177
|
# Then run BEFORE_UPDATE hooks
|
|
@@ -395,19 +397,12 @@ class HookQuerySetMixin:
|
|
|
395
397
|
getattr(refreshed_instance, field.name),
|
|
396
398
|
)
|
|
397
399
|
|
|
398
|
-
#
|
|
399
|
-
|
|
400
|
-
# because subqueries bypass the normal object-level update flow
|
|
401
|
-
should_run_hooks = (
|
|
402
|
-
not current_bypass_hooks
|
|
403
|
-
or has_subquery # Always run hooks for subquery operations
|
|
404
|
-
)
|
|
405
|
-
|
|
406
|
-
if should_run_hooks:
|
|
400
|
+
# Salesforce-style: Always run AFTER_UPDATE hooks unless explicitly bypassed
|
|
401
|
+
if not current_bypass_hooks:
|
|
407
402
|
logger.debug("update: running AFTER_UPDATE")
|
|
408
403
|
engine.run(model_cls, AFTER_UPDATE, instances, originals, ctx=ctx)
|
|
409
404
|
else:
|
|
410
|
-
logger.debug("update:
|
|
405
|
+
logger.debug("update: AFTER_UPDATE explicitly bypassed")
|
|
411
406
|
|
|
412
407
|
return update_count
|
|
413
408
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "django-bulk-hooks"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.244"
|
|
4
4
|
description = "Hook-style hooks for Django bulk operations like bulk_create and bulk_update."
|
|
5
5
|
authors = ["Konrad Beck <konrad.beck@merchantcapital.co.za>"]
|
|
6
6
|
readme = "README.md"
|
|
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
|
|
File without changes
|