django-bulk-hooks 0.1.275__py3-none-any.whl → 0.1.277__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.
- django_bulk_hooks/queryset.py +13 -8
- {django_bulk_hooks-0.1.275.dist-info → django_bulk_hooks-0.1.277.dist-info}/METADATA +1 -1
- {django_bulk_hooks-0.1.275.dist-info → django_bulk_hooks-0.1.277.dist-info}/RECORD +5 -5
- {django_bulk_hooks-0.1.275.dist-info → django_bulk_hooks-0.1.277.dist-info}/LICENSE +0 -0
- {django_bulk_hooks-0.1.275.dist-info → django_bulk_hooks-0.1.277.dist-info}/WHEEL +0 -0
django_bulk_hooks/queryset.py
CHANGED
|
@@ -586,13 +586,9 @@ class HookQuerySetMixin:
|
|
|
586
586
|
converted_record = []
|
|
587
587
|
for i, field_name in enumerate(unique_fields):
|
|
588
588
|
db_value = existing_record[i]
|
|
589
|
-
#
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
# Convert to string to match how we extract from objects
|
|
593
|
-
converted_record.append(str(db_value))
|
|
594
|
-
else:
|
|
595
|
-
converted_record.append(db_value)
|
|
589
|
+
# Convert all values to strings for consistent comparison
|
|
590
|
+
# This ensures all database values are strings like object values
|
|
591
|
+
converted_record.append(str(db_value))
|
|
596
592
|
converted_tuple = tuple(converted_record)
|
|
597
593
|
existing_records_lookup.add(converted_tuple)
|
|
598
594
|
|
|
@@ -629,7 +625,9 @@ class HookQuerySetMixin:
|
|
|
629
625
|
# Convert to string to match how we convert DB values
|
|
630
626
|
obj_unique_tuple.append(str(value))
|
|
631
627
|
else:
|
|
632
|
-
|
|
628
|
+
# For non-_id fields, also convert to string for consistency
|
|
629
|
+
# This ensures all values are strings like in the database lookup
|
|
630
|
+
obj_unique_tuple.append(str(value))
|
|
633
631
|
obj_unique_tuple = tuple(obj_unique_tuple)
|
|
634
632
|
|
|
635
633
|
logger.debug(
|
|
@@ -700,9 +698,16 @@ class HookQuerySetMixin:
|
|
|
700
698
|
if key in existing_db_map:
|
|
701
699
|
db_record = existing_db_map[key]
|
|
702
700
|
# Copy all fields from the database record to ensure completeness
|
|
701
|
+
# but exclude auto_now_add fields which should never be updated
|
|
703
702
|
populated_fields = []
|
|
704
703
|
for field in model_cls._meta.local_fields:
|
|
705
704
|
if field.name != "id": # Don't overwrite the ID
|
|
705
|
+
# Skip auto_now_add fields for existing records
|
|
706
|
+
if (
|
|
707
|
+
hasattr(field, "auto_now_add")
|
|
708
|
+
and field.auto_now_add
|
|
709
|
+
):
|
|
710
|
+
continue
|
|
706
711
|
db_value = getattr(db_record, field.name)
|
|
707
712
|
if (
|
|
708
713
|
db_value is not None
|
|
@@ -9,9 +9,9 @@ django_bulk_hooks/handler.py,sha256=e_GACTQT-pFF-zL7POeo232MgOikUoCLcxDVInAUiBw,
|
|
|
9
9
|
django_bulk_hooks/manager.py,sha256=3jNWL-EkvGScsliNc7mW-ozQCG6HyaEevI1u1BFS4AA,3836
|
|
10
10
|
django_bulk_hooks/models.py,sha256=WtSfc4GBOG_oOt8n37cVvid0MtFIGze9JYKSixil2y0,4370
|
|
11
11
|
django_bulk_hooks/priority.py,sha256=HG_2D35nga68lBCZmSXTcplXrjFoRgZFRDOy4ROKonY,376
|
|
12
|
-
django_bulk_hooks/queryset.py,sha256=
|
|
12
|
+
django_bulk_hooks/queryset.py,sha256=5fTvjWExvYigAd3lkhuMObZhrMklUDnNv25fcDdnwYg,94893
|
|
13
13
|
django_bulk_hooks/registry.py,sha256=GRUTGVQEO2sdkC9OaZ9Q3U7mM-3Ix83uTyvrlTtpatw,1317
|
|
14
|
-
django_bulk_hooks-0.1.
|
|
15
|
-
django_bulk_hooks-0.1.
|
|
16
|
-
django_bulk_hooks-0.1.
|
|
17
|
-
django_bulk_hooks-0.1.
|
|
14
|
+
django_bulk_hooks-0.1.277.dist-info/LICENSE,sha256=dguKIcbDGeZD-vXWdLyErPUALYOvtX_fO4Zjhq481uk,1088
|
|
15
|
+
django_bulk_hooks-0.1.277.dist-info/METADATA,sha256=33_55hzjZOjivZN_RDhwmrAeD1kzbGcSGkUbNt9AepE,9103
|
|
16
|
+
django_bulk_hooks-0.1.277.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
17
|
+
django_bulk_hooks-0.1.277.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|