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

Can't specify widget for AutoCompleteSelectMultipleField #126

Closed
rlskoeser opened this issue Jun 9, 2015 · 2 comments
Closed

Can't specify widget for AutoCompleteSelectMultipleField #126

rlskoeser opened this issue Jun 9, 2015 · 2 comments

Comments

@rlskoeser
Copy link
Contributor

If you specify a widget option for AutoCompleteSelectMultipleField it is ignored and overwritten, but AutoCompleteSelectField will let you specify one (as long as it is the correct type). It looks like this might also be the case for AutoCompleteField.

This just needs to have the logic from AutoCompleteSelectField duplicated for the other init methods:
https://github.com/crucialfelix/django-ajax-selects/blob/develop/ajax_select/fields.py#L125-L134

Alternatively or additionally, AutoCompleteField seems to allow passing in widget attributes - making that work consistently for all the field classes would be useful and might remove the need for specifying the widget.

@crucialfelix
Copy link
Owner

There shouldn't really be a case where you specify a custom widget. This whole django-ajax-selects thing is basically just the widgets and processing what they return.

It was added 5 years ago: 475b791

and claims to be for issue 9, but that is incorrect. It would be better to remove the option entirely and make the code look more consistent on each one.

@rlskoeser
Copy link
Contributor Author

@crucialfelix my use case was that I wanted to specify placeholder text for the input. There was a way to do it for the select field but not the multiple select field, and since I couldn't do it consistently I had to skip it for now.

I agree, it would probably be better to remove the widget option and make the field objects consistent for passing widget attributes in.

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

No branches or pull requests

2 participants