#25606: field_paths do not work in list_filter when using RelatedOnlyFieldListFilter -------------------------------+-------------------- Reporter: quarkness | Owner: nobody Type: Bug | Status: new Component: contrib.admin | Version: 1.8 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------+-------------------- Given this ModelAdmin:
{{{ class BookAdminRelatedOnlyFilter(admin.ModelAdmin): list_filter = ( 'edition__publisher', ('edition__publisher', RelatedOnlyFieldListFilter), ) }}} The first filter works fine, but the second results in a FieldError: Cannot resolve keyword 'publisher' into field. The reason this happens is because RelatedOnlyFieldListFilter uses field.name instead of the field_path, where field is the result of get_fields_from_path, which returns the 'publisher' field This patch fixes this behaviour: https://github.com/django/django/compare/master...quarkness:related-only- filter-field-path It also improves performance by using .distinct() on the database to get unique values instead of set() -- Ticket URL: <https://code.djangoproject.com/ticket/25606> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.4ea21a54843ec88530630582b7878afb%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.