Hi

here is my views
def phone_register(request, success_url=None,form_class = PhoneForm,
                template_name="phone/phonereg_form.html", extra_context=None):
    userobj = User.objects.get(pk=request.user.id)
    if request.method == 'POST':
        phoneform = form_class(request.POST, instance=userobj)
        if phoneform.is_valid():
            phoneformobj = phoneform.save(commit=False)
            phoneformobj.user = request.user
            phoneformobj.mobile_key = random.randint(1000,10000)
            phoneformobj.save()
            # route_sms(smslane, phoneformobj.phoneno, Your Activation Key
is: phoneformobj.mobile_key)
            return HttpResponseRedirect(success_url or reverse
('goto_dashboard'))
    else:
        phoneform = form_class(instance=userobj)
    if extra_context is None:
        extra_context = {}
    context = RequestContext(request)
    for key, value in extra_context.items():
        context[key] = callable(value) and value() or value
    return render_to_response(template_name,
{'phoneform':phoneform},context_instance=context)
phone_register = login_required(phone_register)

Here is i have pasted the full code
http://pastebin.com/m62209f51

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to