Changes between Initial Version and Version 1 of Ticket #28384
- Timestamp:
- Jul 11, 2017, 9:00:23 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28384
- Property Triage Stage Unreviewed → Accepted
- Property Summary ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary → ModelAdmin.lookup_allowed() incorrectly raises DisallowedModelAdminLookup lookup with foreign key as primary key
-
Ticket #28384 – Description
initial v1 1 Wrote a failing test to demonstrate - same test/code passes on 1.81 Wrote a failing test for `tests/modeladmin/tests.py` to demonstrate - same test/code passes on 1.8 2 2 {{{ 3 3 @isolate_apps('modeladmin') … … 25 25 }}} 26 26 27 I think this is caused by the admin thinking that having a foreign key field as a primary key is the same as concrete inheritance. So when you try and check lookups for {{{restaurant__place__country}}} it thinks 'place' is the concrete parent of 'restaurant' and shortcuts it to {{{restaurant__country}}} which isn't in 'list_filter'. And you can't add {{{restaurant__country}}} to list_filterbecause country isn't actually on restaurant.27 I think this is caused by the admin thinking that having a foreign key field as a primary key is the same as concrete inheritance. So when you try and check lookups for `restaurant__place__country` it thinks 'place' is the concrete parent of 'restaurant' and shortcuts it to `restaurant__country` which isn't in 'list_filter'. And you can't add `restaurant__country` to `list_filter` because country isn't actually on restaurant.