ajax and newforms problems

2007-12-03 Thread super
Some trouble using ajax in with forms. To make things simple a dumb down version I got a two fields : class MyForm(forms.Form): room = forms.ModelChoiceField(queryset=Product.objects.filter(type=1)) attending = forms.ChoiceField(required=False, choices=(('', '-'),)) However eac

Re: newforms problems

2007-10-15 Thread RajeshD
> 1) pass_matched always return False > how can i compare two fields in my class??? def pass_matched(self): if self.fields['pass'] == self.fields['repass']: return True else: return False 1. use self.cleaned_data instead of self.fields 2. call pass_matche

newforms problems

2007-10-15 Thread faypy
hi it's about checking confirmations Field class Foo(Form): pass = CharField(min_length=6,max_length=20) repass = CharField(min_length=6,max_length=20) def pass_matched(self): if self.fields['pass'] == self.fields['repass']: return True else: return Fa

Re: Newforms problems

2007-01-23 Thread [EMAIL PROTECTED]
On Jan 22, 9:23 pm, "gkelly" <[EMAIL PROTECTED]> wrote: > Trying printing out self.clean_data when using the built-in django > server and you'll see what it looks like. Your fields might be empty > strings instead of None, so you should say: > > if self.clean_data.get("city") > > instead of making

Re: Newforms problems

2007-01-22 Thread gkelly
Trying printing out self.clean_data when using the built-in django server and you'll see what it looks like. Your fields might be empty strings instead of None, so you should say: if self.clean_data.get("city") instead of making comparisons to None (which is discouraged in Python, you should use

Newforms problems

2007-01-21 Thread [EMAIL PROTECTED]
Hi there, can someone help me understand why the following code (posted also here: http://dpaste.com/4867/) skips validation in clean_city entirely? Am i not trapping the error correctly by evaluating against None? I need to say that if a city is specified you can't specify a region or a provinc