#23616: 'GenericRel' object has no attribute 'get_related_field'
-------------------------------------+-------------------------------------
Reporter: ranjur | Owner: kswiat
Type: Bug | Status: assigned
Component: | Version: 1.7
contrib.contenttypes | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: GenericRel, django | Needs documentation: 0
1.7, admin, get_related_field, | Patch needs improvement: 0
GenericRelation | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by kswiat):
1.6 again - workaround on 'related_query_name' shows, that this version is
not affected. "if hasattr" condition is not passed and bug line is not
executed.
{{{
#!div style="font-size: 80%"
contrib/admin/options.py, line 310
{{{#!python
if hasattr(field, 'rel'):
if field.rel is None:
# This property or relation doesn't exist, but it's allowed
# since it's ignored in ChangeList.get_filters().
return True
model = field.rel.to
rel_name = field.rel.get_related_field().name
}}}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23616#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.bc27f02957f1a0900deff6a368e6c096%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.