mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #17673 -- Forbid field shadowing.
Thanks Anssi Kääriäinen for the suggestion.
This commit is contained in:
committed by
Tim Graham
parent
f5123c7291
commit
ee9fcb1672
@@ -1068,6 +1068,12 @@ Miscellaneous
|
||||
which does allow primary keys with value 0. It only forbids *autoincrement*
|
||||
primary keys with value 0.
|
||||
|
||||
* Shadowing model fields defined in a parent model has been forbidden as this
|
||||
creates amiguity in the expected model behavior. In addition, any clashing
|
||||
fields in the model inheritance hierarchy results in a system check error.
|
||||
For example, if you use multi-inheritance, you need to define custom primary
|
||||
key fields on parent models, otherwise the default ``id`` fields will clash.
|
||||
|
||||
.. _deprecated-features-1.7:
|
||||
|
||||
Features deprecated in 1.7
|
||||
|
||||
Reference in New Issue
Block a user