You are not logged in.

Change Language:

Profile for apoorvabade

Name apoorvabade
Email Address n/a
Posts15
  • 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!!!!
  • 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!!!
  • 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???
  • Caught VariableDoesNotExist while rendering
    Board >> Django >> Views
    Hello... Can anyone tell me the cause for this???? I am getting this error...
  • Re: function call in templates
    Board >> Django >> Views
    Thanks a lot... It worked :)
  • 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???
  • 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 ---
  • 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
  • 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
  • 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


Powered by Sphene Community Tools