Create issue
Issue #7 invalid
Former user created an issue

I'm getting an error:

"Caught an exception while rendering: 'str' object has no attribute 'all'"

When trying to use autocomplete. I presume it has something with the URLConf section:

autocomplete.register( id = 'artist', queryset = Artist.objects.all(), fields = ('firstName', 'lastName',), limit = 5, )

Here's the applicable lines from my form: from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from django.forms import ModelForm from showbook.booker.models import UserProfile, Employer, EmployerContact, Artist, Skillset, Project, Position, Event, Feedback, Location, Message, Work from django.contrib.admin import widgets from autocomplete.fields import ModelChoiceField

class EmployerEventForm(ModelForm): startDate = forms.DateField(('%m/%d/%Y',), label='Start Date', required=False, widget=forms.DateTimeInput(format='%m/%d/%Y', attrs={ 'class':'input', 'readonly':'readonly', 'size':'10' }), initial="Start Date" ) endDate = forms.DateField(('%m/%d/%Y',), label='End Date', required=False, widget=forms.DateTimeInput(format='%m/%d/%Y', attrs={ 'class':'input', 'readonly':'readonly', 'size':'10' }), initial="End Date" ) artist = forms.ModelChoiceField('artist')

class Meta:
    model = Event
    exclude = ('employer')

Here's my URLConf: from django.conf.urls.defaults import * from django.contrib import admin from showbook.booker import views from autocomplete.views import autocomplete from showbook.booker.models import Artist

autocomplete.register( id = 'artist', queryset = Artist.objects.all(), fields = ('firstName', 'lastName',), limit = 5, )

urlpatterns = patterns('', url('^autocomplete/(\w+)/$', autocomplete, 'autocomplete'), )

Any ideas? Also, I kept getting a syntax error when I had the name="autocomplete" line in as you had it...maybe a different version of django???

Thank you so much for any help.

Comments (3)

  1. Germano Gabbianelli repo owner

    Could please attach one or more files which can reproduce the error?

    Sorry for the delay.

  2. Log in to comment