Ticket #13774: rel_db_type.diff
File rel_db_type.diff, 899 bytes (added by , 14 years ago) |
---|
-
django/db/models/fields/related.py
901 901 # If the database needs similar types for key fields however, the only 902 902 # thing we can do is making AutoField an IntegerField. 903 903 rel_field = self.rel.get_related_field() 904 905 # Calling rel_db_type method of related field if it exists 906 # TODO: make AutoField/PositiveIntegerField/PositiveSmallIntegerField use this method 907 if (hasattr(rel_field, 'rel_db_type')): 908 return rel_field.rel_db_type(connection=connection) 909 904 910 if (isinstance(rel_field, AutoField) or 905 911 (not connection.features.related_fields_match_type and 906 912 isinstance(rel_field, (PositiveIntegerField,