views.py:
class ajax_profile():
def __init__(self, request):
username = request.REQUEST.get('username','')
email = request.REQUEST.get('email','')
password = request.REQUEST.get('password','')
action = request.REQUEST.get('action','')
options = {
'check_username' : self.check_username(username),
'check_email' : self.check_email(email),
'forgot_password' : self.forgot_password(email),
'login' : self.login(username, password),
}
options[action]
def check_username(self, username):
return HttpResponse('Test %s' % username)
def check_email(self, email):
pass
def forgot_password(self, email):
pass
def login(self, username, password):
pass
urls.py
(r'^ajax_profile/$', 'apps.profiles.views.ajax_profile'),
URL to call
ajax_profile/?action=check_username&username=testtest
ERROR: instance has no attribute 'status_code'
Why?