plain.models 0.39.1__py3-none-any.whl → 0.39.2__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.
plain/models/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # plain-models changelog
2
2
 
3
+ ## [0.39.2](https://github.com/dropseed/plain/releases/plain-models@0.39.2) (2025-07-25)
4
+
5
+ ### What's changed
6
+
7
+ - Fixed remaining `to_field_name` attribute usage in `ModelMultipleChoiceField` validation to use `id` directly ([26c80356d3](https://github.com/dropseed/plain/commit/26c80356d3))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - No changes required
12
+
3
13
  ## [0.39.1](https://github.com/dropseed/plain/releases/plain-models@0.39.1) (2025-07-22)
4
14
 
5
15
  ### What's changed
plain/models/forms.py CHANGED
@@ -573,7 +573,6 @@ class ModelMultipleChoiceField(ModelChoiceField):
573
573
  corresponding objects. Raise a ValidationError if a given value is
574
574
  invalid (not a valid PK, not in the queryset, etc.)
575
575
  """
576
- key = self.to_field_name or "id"
577
576
  # deduplicate given values to avoid creating many querysets or
578
577
  # requiring the database backend deduplicate efficiently.
579
578
  try:
@@ -586,15 +585,15 @@ class ModelMultipleChoiceField(ModelChoiceField):
586
585
  )
587
586
  for id_val in value:
588
587
  try:
589
- self.queryset.filter(**{key: id_val})
588
+ self.queryset.filter(id=id_val)
590
589
  except (ValueError, TypeError):
591
590
  raise ValidationError(
592
591
  self.error_messages["invalid_id_value"],
593
592
  code="invalid_id_value",
594
593
  params={"id": id_val},
595
594
  )
596
- qs = self.queryset.filter(**{f"{key}__in": value})
597
- ids = {str(getattr(o, key)) for o in qs}
595
+ qs = self.queryset.filter(id__in=value)
596
+ ids = {str(o.id) for o in qs}
598
597
  for val in value:
599
598
  if str(val) not in ids:
600
599
  raise ValidationError(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.models
3
- Version: 0.39.1
3
+ Version: 0.39.2
4
4
  Summary: Database models for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- plain/models/CHANGELOG.md,sha256=7E1ExS5gP9KotEEmAHBG-fOI6XbidxQhLW_xtppI_P0,7688
1
+ plain/models/CHANGELOG.md,sha256=sZMW5wLHmFJ3v1aZeUHsVI3QX8tnKhpivshBn7sNlJs,8028
2
2
  plain/models/README.md,sha256=c5Z7YHxsS72mBS9SZuVoJhudwuAQJDm7tYBeh5fwib0,2591
3
3
  plain/models/__init__.py,sha256=LJhlJauhTfUySY2hTJ9qBhCbEKMxTDKpeVrjYXZnsCw,2964
4
4
  plain/models/aggregates.py,sha256=P0mhsMl1VZt2CVHMuCHnNI8SxZ9citjDLEgioN6NOpo,7240
@@ -16,7 +16,7 @@ plain/models/entrypoints.py,sha256=EC14mW19tK9dCumaNHnv4_9jQV8jomQ8jXy8Ib89VBw,1
16
16
  plain/models/enums.py,sha256=Zr-JKt2aeYsSADtAm69fDRfajS7jYwop2vWQVLJ9YYI,2726
17
17
  plain/models/exceptions.py,sha256=IqzK60-hY3TYsgOMxlWwgpVa21E7ydC-gqUG4tNvVJc,2042
18
18
  plain/models/expressions.py,sha256=hN6sfOxqxpP0qmYOUotsFAAn2-bnl35iHwyINyXA7CI,62763
19
- plain/models/forms.py,sha256=QiOmK5marpup-MbKd6_uX_J48jhjE1KELf3nGcn09bc,25885
19
+ plain/models/forms.py,sha256=FUBgt1P-4JmSQeigdITYqZPYqDI89XZQfPtdr8ffgsc,25816
20
20
  plain/models/indexes.py,sha256=fazIZPJgCX5_Bhwk7MQy3YbWOxpHvaCe1dDLGGldTuY,11540
21
21
  plain/models/lookups.py,sha256=eCsxQXUcOoAa_U_fAAd3edcgXI1wfyFW8hPgUh8TwTo,24776
22
22
  plain/models/manager.py,sha256=zc2W-vTTk3zkDXCds5-TCXgLhVmM4PdQb-qtu-njeLQ,5827
@@ -114,8 +114,8 @@ plain/models/sql/where.py,sha256=ezE9Clt2BmKo-I7ARsgqZ_aVA-1UdayCwr6ULSWZL6c,126
114
114
  plain/models/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
115
  plain/models/test/pytest.py,sha256=KD5-mxonBxOYIhUh9Ql5uJOIiC9R4t-LYfb6sjA0UdE,3486
116
116
  plain/models/test/utils.py,sha256=S3d6zf3OFWDxB_kBJr0tDvwn51bjwDVWKPumv37N-p8,467
117
- plain_models-0.39.1.dist-info/METADATA,sha256=9C2WDp2OBOj6T60Htwy_opbFjwxjW4R1CnAk6pYub1Y,2886
118
- plain_models-0.39.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
119
- plain_models-0.39.1.dist-info/entry_points.txt,sha256=IYJAW9MpL3PXyXFWmKmALagAGXC_5rzBn2eEGJlcV04,112
120
- plain_models-0.39.1.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
121
- plain_models-0.39.1.dist-info/RECORD,,
117
+ plain_models-0.39.2.dist-info/METADATA,sha256=Qa0gXCRQ59--VybcXoc-dOsLzVn-FCNST50xAqPk4w0,2886
118
+ plain_models-0.39.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
119
+ plain_models-0.39.2.dist-info/entry_points.txt,sha256=IYJAW9MpL3PXyXFWmKmALagAGXC_5rzBn2eEGJlcV04,112
120
+ plain_models-0.39.2.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
121
+ plain_models-0.39.2.dist-info/RECORD,,