Changes between Initial Version and Version 1 of Ticket #27259, comment 3


Ignore:
Timestamp:
Sep 26, 2016, 6:16:45 AM (8 years ago)
Author:
Maxim Syabro

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27259, comment 3

    initial v1  
    22
    33
    4 {{{
     4{{{#!python
    55class MainModel(models.Model):
    66    relatedmodel = IntegerField()
     
    1111
    1212Turns out ReverseManyToOneDescriptor will replace original field. So I think it's ambiguous a little bit. Don't you think?
    13 {{{
    14         from .models import MainModel
    15         for i, field in enumerate(MainModel._meta.get_fields()):
    16             fieldname = field.name
    17             print i, fieldname
    18             print getattr(MainModel, fieldname, None)
    19             print getattr(MainModel, fieldname + '_set', None)
    20             print
     13{{{#!python
     14from .models import MainModel
     15for i, field in enumerate(MainModel._meta.get_fields()):
     16    fieldname = field.name
     17    print i, fieldname
     18    print getattr(MainModel, fieldname, None)
     19    print getattr(MainModel, fieldname + '_set', None)
     20    print
    2121}}}
    2222will give this output
Back to Top