def process_request(self, request):
        self.user = request.user
        setattr(request.__class__,
                my_profile_module_name,
                SimpleLazyObject(lambda: get_profile(request.user)))


                from django.core.urlresolvers import reverse
                from django.http import HttpResponseRedirect
                from django.contrib import messages
Example #2
0
 def process_request(self, request):
     self.user = request.user
     setattr(request.__class__, my_profile_module_name,
             SimpleLazyObject(lambda: get_profile(request.user)))
Example #3
0
 def process_request(self, request):
     lazygetprofile = SimpleLazyObject(lambda: get_profile(request.user))
     setattr(request, my_profile_module_name, lazygetprofile)
     setattr(request.user, my_profile_module_name, lazygetprofile)
Example #4
0
 def process_request(self, request):
     self.user = request.user
     setattr(request.__class__, my_profile_module_name, SimpleLazyObject(lambda: get_profile(request.user)))
 def lazy_profile(self):
     return get_profile(self.user)