django-bulk-hooks 0.1.61__tar.gz → 0.1.62__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.61 → django_bulk_hooks-0.1.62}/PKG-INFO +1 -1
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/manager.py +4 -10
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/pyproject.toml +1 -1
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/LICENSE +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/README.md +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/__init__.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/conditions.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/constants.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/context.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/decorators.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/engine.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/enums.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/handler.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/models.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/priority.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/queryset.py +0 -0
- {django_bulk_hooks-0.1.61 → django_bulk_hooks-0.1.62}/django_bulk_hooks/registry.py +0 -0
|
@@ -22,7 +22,7 @@ class BulkLifecycleManager(models.Manager):
|
|
|
22
22
|
return LifecycleQuerySet(self.model, using=self._db)
|
|
23
23
|
|
|
24
24
|
@transaction.atomic
|
|
25
|
-
def bulk_update(self, objs, fields,
|
|
25
|
+
def bulk_update(self, objs, fields, bypass_hooks=False, **kwargs):
|
|
26
26
|
if not objs:
|
|
27
27
|
return []
|
|
28
28
|
|
|
@@ -53,9 +53,7 @@ class BulkLifecycleManager(models.Manager):
|
|
|
53
53
|
for i in range(0, len(objs), self.CHUNK_SIZE):
|
|
54
54
|
chunk = objs[i : i + self.CHUNK_SIZE]
|
|
55
55
|
# Call the base implementation to avoid re-triggering this method
|
|
56
|
-
super(models.Manager, self).bulk_update(
|
|
57
|
-
chunk, fields, batch_size=batch_size
|
|
58
|
-
)
|
|
56
|
+
super(models.Manager, self).bulk_update(chunk, fields, **kwargs)
|
|
59
57
|
|
|
60
58
|
if not bypass_hooks:
|
|
61
59
|
engine.run(model_cls, AFTER_UPDATE, objs, originals, ctx=ctx)
|
|
@@ -106,9 +104,7 @@ class BulkLifecycleManager(models.Manager):
|
|
|
106
104
|
return modified_fields
|
|
107
105
|
|
|
108
106
|
@transaction.atomic
|
|
109
|
-
def bulk_create(
|
|
110
|
-
self, objs, batch_size=None, ignore_conflicts=False, bypass_hooks=False
|
|
111
|
-
):
|
|
107
|
+
def bulk_create(self, objs, bypass_hooks=False, **kwargs):
|
|
112
108
|
model_cls = self.model
|
|
113
109
|
|
|
114
110
|
if any(not isinstance(obj, model_cls) for obj in objs):
|
|
@@ -125,9 +121,7 @@ class BulkLifecycleManager(models.Manager):
|
|
|
125
121
|
for i in range(0, len(objs), self.CHUNK_SIZE):
|
|
126
122
|
chunk = objs[i : i + self.CHUNK_SIZE]
|
|
127
123
|
result.extend(
|
|
128
|
-
super(models.Manager, self).bulk_create(
|
|
129
|
-
chunk, batch_size=batch_size, ignore_conflicts=ignore_conflicts
|
|
130
|
-
)
|
|
124
|
+
super(models.Manager, self).bulk_create(chunk, **kwargs)
|
|
131
125
|
)
|
|
132
126
|
|
|
133
127
|
if not bypass_hooks:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "django-bulk-hooks"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.62"
|
|
4
4
|
description = "Lifecycle-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
|