django-bulk-hooks 0.1.237__tar.gz → 0.1.238__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.237 → django_bulk_hooks-0.1.238}/PKG-INFO +1 -1
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/queryset.py +17 -8
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/pyproject.toml +1 -1
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/LICENSE +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/README.md +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/__init__.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/conditions.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/constants.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/context.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/decorators.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/engine.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/enums.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/handler.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/manager.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/models.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/priority.py +0 -0
- {django_bulk_hooks-0.1.237 → django_bulk_hooks-0.1.238}/django_bulk_hooks/registry.py +0 -0
|
@@ -121,20 +121,29 @@ class HookQuerySetMixin:
|
|
|
121
121
|
obj_pk = getattr(obj, "pk", None)
|
|
122
122
|
if obj_pk is None:
|
|
123
123
|
continue
|
|
124
|
-
|
|
125
|
-
#
|
|
124
|
+
|
|
125
|
+
# Determine value and output field
|
|
126
126
|
if getattr(field_obj, "is_relation", False):
|
|
127
|
-
#
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
# For FK fields, store the raw id and target field output type
|
|
128
|
+
value = getattr(obj, field_obj.attname, None)
|
|
129
|
+
output_field = field_obj.target_field
|
|
130
|
+
target_name = (
|
|
131
|
+
field_obj.attname
|
|
132
|
+
) # use column name (e.g., fk_id)
|
|
133
|
+
else:
|
|
134
|
+
value = getattr(obj, field_name)
|
|
135
|
+
output_field = field_obj
|
|
136
|
+
target_name = field_name
|
|
130
137
|
|
|
131
138
|
when_statements.append(
|
|
132
|
-
When(
|
|
139
|
+
When(
|
|
140
|
+
pk=obj_pk, then=Value(value, output_field=output_field)
|
|
141
|
+
)
|
|
133
142
|
)
|
|
134
143
|
|
|
135
144
|
if when_statements:
|
|
136
|
-
case_statements[
|
|
137
|
-
*when_statements, output_field=
|
|
145
|
+
case_statements[target_name] = Case(
|
|
146
|
+
*when_statements, output_field=output_field
|
|
138
147
|
)
|
|
139
148
|
|
|
140
149
|
# Merge extra CASE updates into kwargs for DB update
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "django-bulk-hooks"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.238"
|
|
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
|