> Try this below code. I guess this will solve your purpose > > # pull a recordset of the users > userdata = auth_user.objects.all() > > def user_filler(self): > for i in userdata: > self[i.id] = '%s, %s', (i.firstname, i.lastname) > return self.items() >
from django import forms from django.contrib.auth.models import User # pull a recordset of the users userdata = User.objects.all() def myuserlist(self): for i in userdata: self[i.id]='%s %s', (i.first_name,i.last_name) <<<ERROR HERE return self.items() #used to post messages to oher users class FrmIdMessage (forms.Form): posted_to = forms.ChoiceField (required=True,widget=forms.CheckboxSelectMultiple(attrs= {'class':'optchecklist'},choices=myuserlist(userdata))) message = forms.CharField (max_length=300, required=True, widget=forms.Textarea(attrs={'class':'smallblob'})) I get a traceback at line 9 (flagged with <<< ERROR HERE above) Traceback is : QuerySet' object does not support item assignment --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---