Now uses model._meta.parents to determine superclasses. _meta.parents is a dict of superclass: field_to_superclass pairs. By using the field name of field_to_superclass, we can work out the field to use the django_polymorphic accessor on, even if a user-specified OneToOneField to parent is is used (with parent_link=True) to get to the parent in the inheritance hierarachy. For subclasses, the path to the subclasses can be manually specified by the user if they use a 'related_name' on the OneToOneField from the subclass to the superclass. I have changed the code to also support 'related_name' if present |
||
|---|---|---|
| .. | ||
| locale | ||
| templates/admin/polymorphic | ||
| templatetags | ||
| __init__.py | ||
| __version__.py | ||
| admin.py | ||
| base.py | ||
| manager.py | ||
| models.py | ||
| polymorphic_model.py | ||
| query.py | ||
| query_translate.py | ||
| showfields.py | ||
| tests.py | ||
| tools_for_tests.py | ||