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
> 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
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
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
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
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
6 matches
Mail list logo