IntrospectionTests incorrectly validates an AutoField as an IntegerField
|Reported by:||manfre||Owned by:||manfre|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The Reporter model doesn't have an explicitly defined primary_key and should have an implicit AutoField(primary_key=True) added to the model.
None of the core backends support introspecting an AutoField, but some 3rd party backends do (django-mssql). I propose adding a new DatabaseFeature can_introspect_autofield that allows backends to decide whether they can distinguish between an AutoField and an IntegerField.
Change History (5)
comment:1 Changed 3 years ago by manfre
- Needs documentation unset
- Needs tests unset
- Owner changed from nobody to anonymous
- Patch needs improvement unset
- Status changed from new to assigned