django-bulk-hooks 0.1.114__py3-none-any.whl → 0.1.115__py3-none-any.whl

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.

@@ -209,10 +209,27 @@ class BulkHookManager(models.Manager):
209
209
  obj, child_model, parent_objects_map.get(id(obj), {})
210
210
  )
211
211
  child_objects.append(child_obj)
212
- # Use Django's _base_manager for child table to avoid recursion
213
- child_manager = child_model._base_manager
214
- child_manager._for_write = True
215
- created = child_manager.bulk_create(child_objects, **kwargs)
212
+ # If the child model is still MTI, call our own logic recursively
213
+ if len([p for p in child_model._meta.parents.keys() if not p._meta.proxy]) > 0:
214
+ # Build inheritance chain for the child model
215
+ inheritance_chain = []
216
+ current_model = child_model
217
+ while current_model:
218
+ if not current_model._meta.proxy:
219
+ inheritance_chain.append(current_model)
220
+ parents = [
221
+ parent
222
+ for parent in current_model._meta.parents.keys()
223
+ if not parent._meta.proxy
224
+ ]
225
+ current_model = parents[0] if parents else None
226
+ inheritance_chain.reverse()
227
+ created = self._mti_bulk_create(child_objects, inheritance_chain, **kwargs)
228
+ else:
229
+ # Single-table, safe to use bulk_create
230
+ child_manager = child_model._base_manager
231
+ child_manager._for_write = True
232
+ created = child_manager.bulk_create(child_objects, **kwargs)
216
233
  # Step 3: Update original objects with generated PKs and state
217
234
  pk_field_name = child_model._meta.pk.name
218
235
  for orig_obj, child_obj in zip(batch, created):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-bulk-hooks
3
- Version: 0.1.114
3
+ Version: 0.1.115
4
4
  Summary: Hook-style hooks for Django bulk operations like bulk_create and bulk_update.
5
5
  Home-page: https://github.com/AugendLimited/django-bulk-hooks
6
6
  License: MIT
@@ -6,12 +6,12 @@ django_bulk_hooks/decorators.py,sha256=tckDcxtOzKCbgvS9QydgeIAWTFDEl-ch3_Q--ruEG
6
6
  django_bulk_hooks/engine.py,sha256=3HbgV12JRYIy9IlygHPxZiHnFXj7EwzLyTuJNQeVIoI,1402
7
7
  django_bulk_hooks/enums.py,sha256=Zo8_tJzuzZ2IKfVc7gZ-0tWPT8q1QhqZbAyoh9ZVJbs,381
8
8
  django_bulk_hooks/handler.py,sha256=xZt8iNdYF-ACz-MnKMY0co6scWINU5V5wC1lyDn844k,4854
9
- django_bulk_hooks/manager.py,sha256=XJzWQmkJB-gkAn3YGDnOdkNG-cZlsw8FdNljlH4LMYo,12510
9
+ django_bulk_hooks/manager.py,sha256=sQ9xDCo3MRp2CNwsfo_a_43LzlWlSdqqoz04oUp6sx8,13351
10
10
  django_bulk_hooks/models.py,sha256=7RG7GrOdHXFjGVPV4FPRZVNMIHHW-hMCi6hn9LH_hVI,3331
11
11
  django_bulk_hooks/priority.py,sha256=HG_2D35nga68lBCZmSXTcplXrjFoRgZFRDOy4ROKonY,376
12
12
  django_bulk_hooks/queryset.py,sha256=iet4z-9SKhnresA4FBQbxx9rdYnoaOWbw9LUlGftlP0,1466
13
13
  django_bulk_hooks/registry.py,sha256=-mQBizJ06nz_tajZBinViKx_uP2Tbc1tIpTEMv7lwKA,705
14
- django_bulk_hooks-0.1.114.dist-info/LICENSE,sha256=dguKIcbDGeZD-vXWdLyErPUALYOvtX_fO4Zjhq481uk,1088
15
- django_bulk_hooks-0.1.114.dist-info/METADATA,sha256=kBeLbf-3zu0TB1uCfJbIMDlf-hvNMj3UAC-JXkwyNeM,6939
16
- django_bulk_hooks-0.1.114.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
17
- django_bulk_hooks-0.1.114.dist-info/RECORD,,
14
+ django_bulk_hooks-0.1.115.dist-info/LICENSE,sha256=dguKIcbDGeZD-vXWdLyErPUALYOvtX_fO4Zjhq481uk,1088
15
+ django_bulk_hooks-0.1.115.dist-info/METADATA,sha256=uA5Qw2PzVWnyDRiGHqr6pF3AdeoQ4xhMUh_eJSoOSRs,6939
16
+ django_bulk_hooks-0.1.115.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
17
+ django_bulk_hooks-0.1.115.dist-info/RECORD,,