

def db_type(self, connection):
    rel_field = self.rel.get_related_field()
    if (isinstance(rel_field, AutoField) or ((not connection.features.related_fields_match_type) and isinstance(rel_field, (PositiveIntegerField, PositiveSmallIntegerField)))):
        return IntegerField().db_type(connection=connection)
    return rel_field.db_type(connection=connection)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/db/models/fields/related.py ForeignKey.db_type/original