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

'AutoCompleteSelectWidget' object has no attribute 'choices' #111

Closed
harshil07 opened this issue Mar 19, 2015 · 1 comment
Closed

'AutoCompleteSelectWidget' object has no attribute 'choices' #111

harshil07 opened this issue Mar 19, 2015 · 1 comment

Comments

@harshil07
Copy link

Getting the following error with Django 1.7 and AjaxSelectAdmin

'AutoCompleteSelectWidget' object has no attribute 'choices'

Here is the stack

        form = super(AjaxSelectAdmin, self).get_form(request, obj, **kwargs) ...
local/lib/python2.7/site-packages/django/contrib/admin/options.py in get_form
            return modelform_factory(self.model, **defaults) ...
local/lib/python2.7/site-packages/django/forms/models.py in modelform_factory
    return type(form)(class_name, (form,), form_class_attrs) ...
local/lib/python2.7/site-packages/django/forms/models.py in __new__
                                      opts.help_texts, opts.error_messages) ...
local/lib/python2.7/site-packages/django/forms/models.py in fields_for_model
            formfield = formfield_callback(f, **kwargs) ...
local/lib/python2.7/site-packages/django/contrib/admin/options.py in formfield_for_dbfield
                    can_add_related=can_add_related) ...
local/lib/python2.7/site-packages/django/contrib/admin/widgets.py in __init__
        self.choices = widget.choices ...
@crucialfelix
Copy link
Owner

I would need to see some more of your code. Maybe the field you are using it on is not a foreign key.

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