model validation does not report duplicate auto-generated "id" column
|Reported by:||mir@…||Owned by:||adrian|
|Component:||Database layer (models, ORM)||Version:||magic-removal|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This is a complicated case ...
If you set up a model class with a field named "id" and without any primary key, Django will add an AutoField named "ID". This leads to a duplicate field name, producing strange effects (django.db.models.query.find_field will report that there's no "id" field at all ...) which are hard to hunt down.