#32847: Adjust models.E025 system check for updated field descriptor setting.
-------------------------------------+-------------------------------------
Reporter: Carlton | Owner: nobody
Gibson |
Type: | Status: new
Cleanup/optimization |
Component: Database | Version: dev
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Fix for #30427 and #16176 adjusted the way field descriptors are set when
subclassing abstract models (the descriptor is now always set of child
class)
This left check `models.E025` as perhaps unnecessary, or in need of
replacement/adjustment.
> **models.E025**: The property `<property name>` clashes with a related
field accessor.
The original check made sure you didn't have a clash with a `@property`
named for a foreign key `_id` attribute, such as `fk_id`.
In this case the field descriptor would not have been set, and you'd have
had the property but not the FK.
This is no longer possible, the descriptor will be applied.
([https://github.com/django/django/pull/14508/files#diff-
8d58c4d1755fbc59fdcb4385fb823cbf8e7a9a76350fd4506590e1878328128dR1211-R1216
See the adjustment to make the test pass here.])
* Can we still though detect that such a configuration error occurred,
i.e. that I named a property `*_id` matching an FK accessor?
* Can we then update the system check (or replace it) and adjust/remove
the `test_property_and_related_field_accessor_clash ` test in
`tests/invalid_models_tests/test_models.py`?
Accepting based on
[https://github.com/django/django/pull/14508/files#r648437192 the
discussion on the PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32847>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/056.709eba4dc54d3542f425c834e896f252%40djangoproject.com.