| Name | apoorvabade |
|---|---|
| Email Address | n/a |
| Posts | 15 |
-
- 2010-06-15 01:35:47
- clean methods for validation
- Board >> Django >> Views
- hi.. i have the following form class with corresponding clean methods...
class SOFIATMUserLogin(forms.Form):
Username=forms.CharField(label='Username')
Password=forms.CharField(label='Password', widget=forms.PasswordInput)
def clean_Username(self):
user=self.cleaned_data['Username']
try:
SOFIALogin.objects.get(UserName=user)
except Exception:
raise forms.ValidationError('Username invalid...')
def clean_Password(self):
upass=self.cleaned_data['Password']
In the clean_Password method i wish to check if the password entered for the valid username is correct... So i need to get the Username value... How can i access this in clean_Password method... Please assist!!!!
-
- 2010-06-11 06:53:25
- Validation errors
- Board >> Django >> Views
- Hi.. My form.is_valid() properly vaidates the fields... the error messages are printed on the console if iask for... But these error messages are not reflected in the browser.. where as they automatically get reflected... i have in my template as:
{{ form.as_table }}...
Please help!!!
-
- 2010-06-11 04:27:57
- Re: Caught VariableDoesNotExist while rendering
- Board >> Django >> Views
- From what i searched online, it says you need to have TEMPLATE_CONTEXT_PROCESSORS installed.... when we create application running
$ django-admin.py startproject test2 ...
but it dint create any....
how to manually create the same???
-
- 2010-06-11 04:10:50
- Caught VariableDoesNotExist while rendering
- Board >> Django >> Views
- Hello... Can anyone tell me the cause for this???? I am getting this error...
-
- 2010-06-11 03:50:28
- Re: function call in templates
- Board >> Django >> Views
- Thanks a lot... It worked

-
- 2010-06-11 03:44:58
- Re: function call in templates
- Board >> Django >> Views
- Hey.. Got the error...
I had created the templatetags folder in project and not in application...
that is where it gave me the error.... Thanks a lot for the answer...
But now i have another question.. My function takes two parameters..
So how do i pass them as arguments... Like you said...
somefunction request.user.... this passes 1 argument to d function..
so is the function call as somefunction request.user1,request.user2 passes 2 arguments to the function somefunction???
-
- 2010-06-11 03:38:09
- Re: function call in templates
- Board >> Django >> Views
- Yes I have it in INSTALLED_APPS...
--- Last Edited by apoorvabade at 2010-06-11 03:38:21 ---
-
- 2010-06-11 03:31:12
- Re: function call in templates
- Board >> Django >> Views
- Hey.. Thanks for your answer... I tried doing the same as you said... But it giving some error which says
TemplateSyntaxError
'mytemplatetags' is not a valid tag library: Template library mytemplatetags not found, tried django.templatetags.mytemplatetags,django.contrib.admin.templatetags.mytemplatetags
-
- 2010-06-11 01:17:12
- function call in templates
- Board >> Django >> Views
- Hi i need to call a function with parameters from django template.. Example: I need to pass logged in username to this funtion to check a certain condition and accordingly need to display a link... Is there any way for this to do???? Please help
-
- 2010-06-09 04:18:41
- Re: form.is_valid() always returns false
- Board >> Django >> Views
- Ok.. i tried to print request.POST.. and it is showing the dictionary contents... But i am unable to get why is form.is_valid() returning false...
I have my SOFIATMUser a class extending forms.FORM


