Re: MultiValueField with required=True problem

2009-05-20 Thread [CPR]-AL.exe
I understood that, i just thought there is some nicer way to do it :) Thx. On Wed, May 20, 2009 at 11:52 PM, Sam Chuparkoff wrote: > > On Wed, 2009-05-20 at 07:09 -0700, [CPR]-AL.exe wrote: > > So, what is the best way to throw a ValidationError only if None of > > values a entered in subclasse

Re: MultiValueField with required=True problem

2009-05-20 Thread Sam Chuparkoff
On Wed, 2009-05-20 at 07:09 -0700, [CPR]-AL.exe wrote: > So, what is the best way to throw a ValidationError only if None of > values a entered in subclassed field? I don't know if you understood my post or read the code for MultiValueField. MultiValueField is designed to check for empty values a

Re: MultiValueField with required=True problem

2009-05-20 Thread [CPR]-AL.exe
So, what is the best way to throw a ValidationError only if None of values a entered in subclassed field? On 19 май, 23:10, Sam Chuparkoff wrote: > On Mon, 2009-05-18 at 10:13 -0700, [CPR]-AL.exe wrote: > > I've created a field+widget set that i use to render a number of > > checkboxes and a Tex

Re: MultiValueField with required=True problem

2009-05-19 Thread Sam Chuparkoff
On Mon, 2009-05-18 at 10:13 -0700, [CPR]-AL.exe wrote: > I've created a field+widget set that i use to render a number of > checkboxes and a TextInput with comma-separated values. > > The problem is, when i set required = True, I get a ValidationError if > only checkboxes are selected (but i don'

Re: MultiValueField with required=True problem

2009-05-19 Thread [CPR]-AL.exe
It is required On 19 май, 08:05, Thierry wrote: > Isn't required the default behaviour of Field: > > http://docs.djangoproject.com/en/dev/ref/forms/fields/ > > From the above code, TextInput is required: > > forms.TextInput(), > > On May 18, 1:15 pm, "[CPR]-AL.exe" wrote: > > > class CheckboxSe

Re: MultiValueField with required=True problem

2009-05-19 Thread [CPR]-AL.exe
And so? I don't get you. How can i requere that the user will select a checkbox OR input some text in TextInput? 2009/5/19 Thierry > Isn't required the default behaviour of Field: > > http://docs.djangoproject.com/en/dev/ref/forms/fields/ > > From the above code, TextInput is required: > > forms

Re: MultiValueField with required=True problem

2009-05-18 Thread Thierry
Isn't required the default behaviour of Field: http://docs.djangoproject.com/en/dev/ref/forms/fields/ From the above code, TextInput is required: forms.TextInput(), On May 18, 1:15 pm, "[CPR]-AL.exe" wrote: > class CheckboxSelectWithTextInputWidget(forms.MultiWidget): > >     def __init__(sel

Re: MultiValueField with required=True problem

2009-05-18 Thread [CPR]-AL.exe
class CheckboxSelectWithTextInputWidget(forms.MultiWidget): def __init__(self,choices, attrs=None): widgets = ( forms.CheckboxSelectMultiple(choices = choices), forms.TextInput(), ) super(CheckboxSelectWithTextInputWidget,self).__init__ (widget

MultiValueField with required=True problem

2009-05-18 Thread [CPR]-AL.exe
Hello there. I've created a field+widget set that i use to render a number of checkboxes and a TextInput with comma-separated values. The problem is, when i set required = True, I get a ValidationError if only checkboxes are selected (but i don't get it if TextInput is filled) Here are the clas