Changes between Initial Version and Version 1 of Ticket #24208, comment 2


Ignore:
Timestamp:
Jan 23, 2015, 5:11:14 AM (9 years ago)
Author:
Tom Christie

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24208, comment 2

    initial v1  
    11Workaround - `.related_model` will return the source model, so...
    22
     3{{{
    34    for relation in opts.get_all_related_objects():
    45        to_model = getattr(relation, 'related_model', relation.model)
     6}}}
    57
    68Appears to work consistently across Django versions.
Back to Top