class xxx(forms.Form):
def __init__(self, list_of_files, *args, **kwargs):
self.fields['files'].choices = enumerate(list_of_files)
super(xxx, self).__init__(*args, **kwargs)
files = forms.MultipleChoiceField(widget=CheckboxSelectMultiple, choices=[])
You then put multiple submit buttons on the form so that you can choose to save
the checked files, delete the checked files, or what (you need to give
them a "name"
attribute to make them show up in the POST data). When your view instantiates
the form, you pass the list of files. When a posted form if valid,
form.checked_data['files']
will be a list of indexes into list of files. You need to be sure
that you have the same
list when you get the post as you had for the get that rendered the form.
Untested, but I've done similar. Should be close.
Bill
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>