Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - span foreign key relationships #7

Open
lordp opened this issue Aug 15, 2024 · 7 comments
Open

Feature request - span foreign key relationships #7

lordp opened this issue Aug 15, 2024 · 7 comments
Assignees
Labels
feature request New feature or request

Comments

@lordp
Copy link

lordp commented Aug 15, 2024

I would love it if you could add the ability to span relationships - please see the same issue report in the predecessor of this package (django-admin-autocomplete-list-filter) for info

demiroren-teknoloji/django-admin-autocomplete-list-filter#2 (comment)

@lordp lordp added the bug Something isn't working label Aug 15, 2024
@vigo
Copy link
Owner

vigo commented Aug 18, 2024

hmm... dalf uses built-in list filters by default. like regular;

list_filter = ['foo__bar__baz']

should also work. i'll check on it. keep you posted.

@vigo
Copy link
Owner

vigo commented Aug 18, 2024

ok, i've seen the problem :)

@vigo vigo added feature request New feature or request and removed bug Something isn't working labels Aug 18, 2024
@vigo
Copy link
Owner

vigo commented Aug 18, 2024

the problem is related to builtin ajax autocomplete view. only completes foreign keys. i'll investigate how to implement this feature. i don't want to override django's builtin views. i'll see what i can do.

@vigo
Copy link
Owner

vigo commented Aug 18, 2024

list_filter = [('foo_bar_baz', DALFRelatedField)]

works. only DALFRelatedFieldAjax doesn't work due to built-in auto complete view.

@lordp
Copy link
Author

lordp commented Aug 18, 2024

Yeah, that's the same point I got to. I will see if I can figure out how to change it myself - thanks.

@vigo
Copy link
Owner

vigo commented Aug 19, 2024

i want to implement it, seems a bit challenging. my main goal was to use all the built-ins shipped with django and kind of wrap around w/o adding or tweaking anything as less as much i can. i'll try to to implement a class which inherits from existing AutocompleView and all i need is to intercept queryset. builtin autocomplete view checks the field's existence. in foo_bar_baz there is no field in the model. view designed to work with FK and M2M fields. I'll try to implement it :) Maybe someone help me out? all PR's are welcome :)

@lordp
Copy link
Author

lordp commented Aug 19, 2024

I found this Stackoverflow answer that may be a good starting point. It's a couple of years old though.

https://stackoverflow.com/questions/70802751/django-admin-autocomplete-field-without-foreignkey-or-manytomany-relationshi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants