diff options
| author | Ben Pietravalle | 2013-11-08 13:19:40 +0000 |
|---|---|---|
| committer | Ben Pietravalle | 2013-11-08 13:19:40 +0000 |
| commit | b7b57adee2cc5a785a5df492424969c8ba311aa8 (patch) | |
| tree | 7ec6250dbf872db0fda960c3a449be5ac2409645 /setup.py | |
| parent | 97430c0d9c608728eb7dc135b9aac4d5327b9247 (diff) | |
| download | django-rest-framework-b7b57adee2cc5a785a5df492424969c8ba311aa8.tar.bz2 | |
Fix object creation with reverse M2M when related_name unspecified
It seems that field.related_query_name() does not return the related_name
for reverse M2M relations when related_name is not explicitly set in the M2M field
definition.
So, change to use obj.get_accessor_name(), where obj is an instance of
RelatedObject, as are returned by a model's
_meta.get_all_related_many_to_many_objects(), or as in the tuples returned by
_meta.get_all_m2m_objects_with_model().
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions
