Ticket #13822: foreignkey_attname.diff

File foreignkey_attname.diff, 575 bytes (added by Alexander Schepanovski, 14 years ago)
  • django/db/models/fields/related.py

     
    835835                'model': self.rel.to._meta.verbose_name, 'pk': value})
    836836
    837837    def get_attname(self):
    838         return '%s_id' % self.name
     838        return self: '%s_%s' % (self.name, self.rel.field_name)
    839839
    840840    def get_validator_unique_lookup_type(self):
    841841        return '%s__%s__exact' % (self.name, self.rel.get_related_field().name)
Back to Top