Urgently required a solution on this
Hi All,
I am facing some issues with respect to validation of a username for unique name characteristic. I am using jQuery validation plugins to valid this using rules for "remote" by called a file on server where in a python file i put my logic for unique name.
I defined a multi value dictionary on the python file. Its basically returns false or true according to existance of that username on the dictinary.
All rest configuration is as per the procedure like setting of templates,etc..
This is my python class:
def create_new_user_account(request):
"""
This function provides a view for creating new user accounts
"""
print 'inside create_new_user_account method'
form = CreateUserForm(request.GET)
username = request.GET.get('user_name')
my_array = {'user' : ['rebecca', 'juan', 'samir', 'heather', 'martin']}
L1 = my_array['user']
valid ='true'
if username not in L1:
valid='false'
print valid
return render_to_response('person/create.html', { 'form': form}, RequestContext(request, {'valid': 'valid',}))
Also i defined a rule and message on the validate() in a js file.
Where if the from from python file is true the corresponding message should be display inline. But it is not displying the message.
Problem is Django cant able to send the response form python file to the js file ..
Should i need more configuration to solve this.
It will be a great help if anybody gave there solution on this issue....
If you want more info then i can provide more information..
Regard,
Biraj