Ticket #15962: 15962.diff

File 15962.diff, 698 bytes (added by bmispelon, 4 years ago)
  • django/db/models/fields/related.py

     
    217217        # related object in a table-spanning query. It uses the lower-cased
    218218        # object_name by default, but this can be overridden with the
    219219        # "related_name" option.
    220         return self.rel.related_name or self.opts.object_name.lower()
     220        return self.rel.related_name or (self.opts.object_name.lower() + '_set')
    221221
    222222class SingleRelatedObjectDescriptor(object):
    223223    # This class provides the functionality that makes the related-object
Back to Top