RE: value for choices arguments for newforms.MultipleSelectField

2007-08-08 Thread Chris Brand
Hi Peter, > What should I pass as a dummy queryset parameter: this is positional > mandatory argument and I cannot pass None. If you're going to replace it before you render the form, it really doesn't matter - any queryset will do. I used .objects.all(), but that has the disadvantage of actua

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-08 Thread Peter Melvyn
On 8/7/07, Chris Brand <[EMAIL PROTECTED]> wrote: > self.fields[f].queryset = queryset > # Have to force the widget to update itself (bug 4787) > self.fields[f].widget.choices = self.fields[f].choices Hi Chris, thanks for your help - it solved my problem,

RE: value for choices arguments for newforms.MultipleSelectField

2007-08-07 Thread Chris Brand
> def my_view(request): > > class MyForm(forms.Form) > emails = forms.ModelMultipleChoiceField(queryset= > MyDBModel.objects.filter(user=request.user.id) > > > But I'd like to have form declaration out of this view na pass user's > ID as an argument - is there any way

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-05 Thread Peter Melvyn
On 2 Srp, 17:35, Nathan Ostgard <[EMAIL PROTECTED]> wrote: > You can use ModelMultipleChoiceField for this: > > items = > newforms.ModelMultipleChoiceField(queryset=Items.objects.all()) Hi Nathan, I use it this way, but I need to reduce the queryset for current user whom ID is contained in HTTP

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-02 Thread Kai Kuehne
Hi, On 8/3/07, james_027 <[EMAIL PROTECTED]> wrote: > I don't see ModelMultipleChoiceField on the documentaion or the latest > source code You can look at http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms/tests.py till the documenation is updated. > Thanks > james

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-02 Thread james_027
H On Aug 2, 11:35 pm, Nathan Ostgard <[EMAIL PROTECTED]> wrote: > You can use ModelMultipleChoiceField for this: > > items = > newforms.ModelMultipleChoiceField(queryset=Items.objects.all()) > I don't see ModelMultipleChoiceField on the documentaion or the latest source code Thanks james --~-

Re: value for choices arguments for newforms.MultipleSelectField

2007-08-02 Thread Nathan Ostgard
You can use ModelMultipleChoiceField for this: items = newforms.ModelMultipleChoiceField(queryset=Items.objects.all()) On Aug 2, 1:24 am, james_027 <[EMAIL PROTECTED]> wrote: > hi > > somewhere on the django documentation I saw the choice provided for > MultipleSelectField is from a Database but