yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.8k stars 467 forks source link

Is there a way to put the search URL in a sub config for a package? #1197

Open bethlakshmi opened 3 years ago

bethlakshmi commented 3 years ago

I'm building a non-admin UI for an app that resides within the Django CMS system. My code is in it's own, isolated package, called "inventory", and my GUI URLs all use their own urlconf. I'd really like to situate the URL for the django-autocomplete-light within that sub config, but it seems like the only urlconf that works is the root. I read the code, and it looks like there's no way to pass a "urlconf" parameter to the widget, the only URL look up call that happens is "reverse(url)" with no other args.

Please let me know if there is a way to do it. If not, please consider this a feature request.

I'd be up for implementing it, if you can point me to your coding standards/PR process?

jpic commented 3 years ago

Does it work when you try this manual ? https://docs.djangoproject.com/en/3.1/topics/http/urls/#including-other-urlconfs

bethlakshmi commented 3 years ago

Ah. I was using name space urls to keep them distinct. So it's the fact that the reverse needs to reference the app_name that is the blocker.

jpic commented 3 years ago

Nice, good to close then ?

bethlakshmi commented 3 years ago

No... I really can't remove the namespace easily and isolating this way is a legitimate use case in django. Is there a way to specify this when setting up the form widget.