plain.models 0.49.0__py3-none-any.whl → 0.49.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 +20 -0
- plain/models/base.py +3 -1
- plain/models/fields/related_descriptors.py +3 -3
- {plain_models-0.49.0.dist-info → plain_models-0.49.2.dist-info}/METADATA +1 -1
- {plain_models-0.49.0.dist-info → plain_models-0.49.2.dist-info}/RECORD +8 -8
- {plain_models-0.49.0.dist-info → plain_models-0.49.2.dist-info}/WHEEL +0 -0
- {plain_models-0.49.0.dist-info → plain_models-0.49.2.dist-info}/entry_points.txt +0 -0
- {plain_models-0.49.0.dist-info → plain_models-0.49.2.dist-info}/licenses/LICENSE +0 -0
plain/models/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# plain-models changelog
|
2
2
|
|
3
|
+
## [0.49.2](https://github.com/dropseed/plain/releases/plain-models@0.49.2) (2025-10-02)
|
4
|
+
|
5
|
+
### What's changed
|
6
|
+
|
7
|
+
- Updated dependency to use the latest plain package version
|
8
|
+
|
9
|
+
### Upgrade instructions
|
10
|
+
|
11
|
+
- No changes required
|
12
|
+
|
13
|
+
## [0.49.1](https://github.com/dropseed/plain/releases/plain-models@0.49.1) (2025-09-29)
|
14
|
+
|
15
|
+
### What's changed
|
16
|
+
|
17
|
+
- Fixed `get_field_display()` method to accept field name as string instead of field object ([1c20405](https://github.com/dropseed/plain/commit/1c20405ac3))
|
18
|
+
|
19
|
+
### Upgrade instructions
|
20
|
+
|
21
|
+
- No changes required
|
22
|
+
|
3
23
|
## [0.49.0](https://github.com/dropseed/plain/releases/plain-models@0.49.0) (2025-09-29)
|
4
24
|
|
5
25
|
### What's changed
|
plain/models/base.py
CHANGED
@@ -665,8 +665,10 @@ class Model(metaclass=ModelBase):
|
|
665
665
|
collector.collect([self])
|
666
666
|
return collector.delete()
|
667
667
|
|
668
|
-
def get_field_display(self,
|
668
|
+
def get_field_display(self, field_name: str) -> str:
|
669
669
|
"""Get the display value for a field, especially useful for fields with choices."""
|
670
|
+
# Get the field object from the field name
|
671
|
+
field = self._meta.get_field(field_name)
|
670
672
|
value = getattr(self, field.attname)
|
671
673
|
|
672
674
|
# If field has no choices, just return the value as string
|
@@ -199,9 +199,9 @@ class ForwardManyToOneDescriptor:
|
|
199
199
|
- ``instance`` is the ``child`` instance
|
200
200
|
- ``value`` is the ``parent`` instance on the right of the equal sign
|
201
201
|
"""
|
202
|
-
# If value is a LazyObject
|
203
|
-
#
|
204
|
-
#
|
202
|
+
# If value is a LazyObject, force its evaluation. For ForeignKey fields,
|
203
|
+
# the value should only be None or a model instance, never a boolean or
|
204
|
+
# other type.
|
205
205
|
if isinstance(value, LazyObject):
|
206
206
|
# This forces evaluation: if it's None, value becomes None;
|
207
207
|
# if it's a User instance, value becomes that instance.
|
@@ -1,9 +1,9 @@
|
|
1
1
|
plain/models/AGENTS.md,sha256=xQQW-z-DehnCUyjiGSBfLqUjoSUdo_W1b0JmwYmWieA,209
|
2
|
-
plain/models/CHANGELOG.md,sha256=
|
2
|
+
plain/models/CHANGELOG.md,sha256=TxKNsII2edA_7a6zQdmZV7ZrnU6dSJ5rLYwJ3ckQeJs,20413
|
3
3
|
plain/models/README.md,sha256=lqzWJrEIxBCHC1P8X1YoRjbsMFlu0-kG4ujP76B_ZO4,8572
|
4
4
|
plain/models/__init__.py,sha256=t6scDQ-bGQD3k-U_DE9K5JJ3pnmkC7ZHchFnWA-BcW8,2845
|
5
5
|
plain/models/aggregates.py,sha256=P1nAyp1XORdlx1D-__Nx9AehUeuKmcjeS6heqjB7A7k,7247
|
6
|
-
plain/models/base.py,sha256
|
6
|
+
plain/models/base.py,sha256=-eaUUAnLTPMckmO2PrIfWsqXSQAhOIZFwD_i7DrcI1I,63952
|
7
7
|
plain/models/cli.py,sha256=rqrgG__OyqtaDaKLB6XZnS6Zv7esU9K9EAyKCO35McA,39548
|
8
8
|
plain/models/config.py,sha256=-m15VY1ZJKWdPGt-5i9fnMvz9LBzPfSRgWmWeEV8Dao,382
|
9
9
|
plain/models/connections.py,sha256=RBNa2FZ0x3C9un6PaYL-IYzH_OesRSpdHNGKvYHGiOM,2276
|
@@ -75,7 +75,7 @@ plain/models/fields/__init__.py,sha256=Pxso0fIHOhf9Czrw-W5x0B7u_mBbhf9KgNzW9QBoJ
|
|
75
75
|
plain/models/fields/json.py,sha256=4WHZX5MI-GZapcaaHltPgc6f9pHAezjfaTYNh_PX8rQ,18041
|
76
76
|
plain/models/fields/mixins.py,sha256=wmu3JJEOimijgepjMEFPN8u74mHpefgnsB4u5ZzVCUY,1890
|
77
77
|
plain/models/fields/related.py,sha256=C69F4umO_oNTbpE5XhI5PBV_tLttBA-jV4lPcsqq6kA,50669
|
78
|
-
plain/models/fields/related_descriptors.py,sha256
|
78
|
+
plain/models/fields/related_descriptors.py,sha256=-sO0b6Cbi2Nmjk7uojEwu7DlCTSiQnP7yFh--Sgurgw,15091
|
79
79
|
plain/models/fields/related_lookups.py,sha256=9y6AfEcg8xRRZne2LXFP6jym9mecFlB_toYih7lD8Uw,7781
|
80
80
|
plain/models/fields/related_managers.py,sha256=MxxOY5iMmHgpZR7qt9ZPbdvw8pN_B39siBJgdDXgS2A,25060
|
81
81
|
plain/models/fields/reverse_related.py,sha256=uAePNDx6h-7duDeJyMPBPm0DpUM39YZKxrO6G8Lgm_A,10389
|
@@ -115,8 +115,8 @@ plain/models/sql/where.py,sha256=P_2EFg-BMIu9jTZFiiPwz1E74jlSitiP-taShCp5OhU,126
|
|
115
115
|
plain/models/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
116
|
plain/models/test/pytest.py,sha256=KD5-mxonBxOYIhUh9Ql5uJOIiC9R4t-LYfb6sjA0UdE,3486
|
117
117
|
plain/models/test/utils.py,sha256=S3d6zf3OFWDxB_kBJr0tDvwn51bjwDVWKPumv37N-p8,467
|
118
|
-
plain_models-0.49.
|
119
|
-
plain_models-0.49.
|
120
|
-
plain_models-0.49.
|
121
|
-
plain_models-0.49.
|
122
|
-
plain_models-0.49.
|
118
|
+
plain_models-0.49.2.dist-info/METADATA,sha256=glyTbshvz-ZsHIZFWquxv8ycxOddg78GgOZCtdRMyys,8884
|
119
|
+
plain_models-0.49.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
120
|
+
plain_models-0.49.2.dist-info/entry_points.txt,sha256=IYJAW9MpL3PXyXFWmKmALagAGXC_5rzBn2eEGJlcV04,112
|
121
|
+
plain_models-0.49.2.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
|
122
|
+
plain_models-0.49.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|