Cleanup of ForeignKey.db_type
|Reported by:||Waldemar Kornewald||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The attached patch cleans up the db_type() function for ForeignKey. It adds a Field.related_db_type() method which returns the db_type for the ForeignKey pointing at that field. Previously, ForeignKey.db_type() had hard-coded isinstance() checks.