Open salomvary opened 3 years ago
Oops, seems like I've created this pull request from the main branch of my fork, which contains all kinds of unrelated changes. Let me know if there is interest in fixing the original "custom related pk name" problem and I will clean up this pr.
as i promised, here is the current one: https://github.com/vigo/django-admin-list-filter
If the related model's primary key is not named
id
, use the right primary key name when constructing the query param name.I've also sneaked in two loosely related changes, feel free to cherry-pick them:
get_queryset_for_field
with a simplefield.related_model.objects.get_queryset()
call. If there is a reason for not using that, feel free to remove, but if that is the case, it would also help future contributors if there was an explanatory comment present.