I have ModelMultipleChoiceField working for me OK, but I am not sure I
understand your question. Could you be a bit more specific?

This is a snippet from my code which may or may not help:

class PictureForm(ModelForm):
    tags = ModelMultipleChoiceField(queryset=Tag.objects.all(),
widget=CheckboxSelectMultiple, required=False)
    class Meta:
        model  = Picture
        fields = ('title', .... , 'tags')

# the view:
def edit_picture(request, pic_id):
    pic  = get_object_or_404(Picture, pk=pic_id)

    if request.method == "POST":
        pic_form = PictureForm(request.POST, instance=pic)
        if pic_form.is_valid():
            pic_form.save()
    else:
        pic_form    = PictureForm(instance=pic)

    return render_to_response("cat/edit_picture.html", dict(
        pic_form    = pic_form
    ))


On Nov 28, 3:05 pm, Gloria <strang...@comcast.net> wrote:
> Hi all,
> I've spent way too much time getting trying to get this widget to work
> the way I am envisioning.
> In the forms, I want to initialize it, but in the view I need to
> determine which boxes are checked.
> Has anyone done this without writing their own widget? It would be
> great to know how.
> Thank you in advance,
> Gloria

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to