Do want to initialize a choice field? You can do this with forms

class SomeForm(forms.Form):


    interest         = forms.ChoiceField( choices=(),
 
widget=forms.Select(attrs={})
                                        )

    def __init__(self, *args, **kwargs):
        super(SomeForm, self).__init__(*args, **kwargs)
        self.fields['interest'].choices = [(i.interest,i.interest) for
i in Interest.objects.filter(status='standard')]



On Nov 20, 10:41 pm, 郁夫 <szxa...@gmail.com> wrote:
> hi.
>
> I have a forms.ChoiceField , I want with a queryset  field value.
>
> thank
>
> --
> ××××××××××××××××××××××××http://szxatjp.blog.163.com/
> ××××××××××××××××××××××××

-- 
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.

Reply via email to