Hello. I've found this great video overview of DAL and installed demo-project, but i can't find dependant autocomplete in the admin.
Here is the example of it in the video: https://youtu.be/fJIHiqWKUXI?t=333
Can you please guide me to the right direction?
Thanks
It's in the tutorial: http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#filtering-results-based-on-the-value-of-other-fields-in-the-form
@jpic thanks for sharing. Sadly, it looks too complicated for me at the moment. Don't you have that good old City -> Country example somewhere?
@Senpos
The concept is the following: DAL JS picks a field value that you choose and passes it as an additional parameter to the request to autocomplete view. So all you have to do is specify which field value do you want to pass (forward parameter for widget) to the view and handle it on server side (in the view).
There are some examples in the test_project folder in this repo, but unfortunately they are a little bit more abstract that city->country. The simplest one is linked_data. There are also rename_forward and forward_different_fields examples to demonstrate more advanced use of forwarding.
@Senpos shameless plug with a complicated example: this thing in my project https://github.com/mpasternak/django-bpp/blob/dev/src/bpp/admin/praca_habilitacyjna.py#L43 will forward the field "autor" of every row in the the _inline_ form to the widget. "Forward" as in "get the value using javascript and pass it as JSon".
I'm not sure where that example did go. Have more questions?
@jpic @gagarski @mpasternak
Thanks for help and useful links, will take a look at all of these stuff! 馃憤
Will mark this topic as closed now.
Most helpful comment
@Senpos shameless plug with a complicated example: this thing in my project https://github.com/mpasternak/django-bpp/blob/dev/src/bpp/admin/praca_habilitacyjna.py#L43 will forward the field "autor" of every row in the the _inline_ form to the widget. "Forward" as in "get the value using javascript and pass it as JSon".
I'm not sure where that example did go. Have more questions?