I need the user to be able to check the box on groups that apply to them. This was really easy to do with oldforms ...
VIEWS: # Get all that user's groups groups = Groups.objects.filter(userProfile__user__pk=request.user.id) # Create the FormWrapper, template, context, response form = forms.FormWrapper(manipulator, new_data, errors) return render_to_response('myaccount.html', {'form': form, 'user' : request.user,'groups' : groups}) TEMPLATE: {% for g in groups %} <tr> <td class="group_title" > <a href="/my_groups/{{ g.groups_hash }}">{{ g.name }}</a> </td> <td> <input type="checkbox" name="{{ g.groups_hash }}" > </td> </tr> {% endfor %} Couldn't be simpler. But now in newforms, i'm a bit lost ... VIEWS: # Get all that user's groups groups = Groups.objects.filter(userProfile__user__pk=request.user.id) # Campaign form class CampaignsForm(forms.Form): name = forms.CharField(required=True, max_length=40) description = forms.CharField(required=True, max_length=1000, widget=forms.Textarea(attrs={'rows':'7','cols':'25'})) send_date = forms.CharField(required=False) groups = forms.CharField(widget=forms.Select()) def __init__(self, groups, *args, **kwargs): super(CampaignsForm, self).__init__(args, kwargs) self.fields['groups'].choices = groups # THis gives me a an empty groups drop-down menu and triggers all the errors on the form. I also especially want to render checkboxes using only that user's groups and not have a drop-down menu. Thanks --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---