Changes between Version 6 and Version 7 of Ticket #27259


Ignore:
Timestamp:
Sep 26, 2016, 6:47:15 AM (8 years ago)
Author:
Maxim Syabro
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27259 – Description

    v6 v7  
    1 Okay, will do. Thanks
     1F.e.
     2{{{#!python
     3class MainModel(models.Model):
     4pass
     5
     6class RelatedModel(models.Model):
     7main = models.ForeignKey(MainModel)
     8}}}
     9
     10{{{ManyToOneRel.name}}} should be {{{relatedmodel_set}}}, not
     11{{{relatedmodel}}}
     12
     13{{{#!python
     14>>> from testmodels.models import MainModel
     15>>> fieldname = MainModel._meta.get_fields()[0].name
     16>>> print getattr(MainModel, fieldname, None)
     17None
     18>>> print getattr(MainModel, fieldname + '_set', None)
     19object at 0x103dc1510>}}}
Back to Top