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
def process_request(self, request): self.user = request.user setattr(request.__class__, my_profile_module_name, SimpleLazyObject(lambda: get_profile(request.user)))
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)
def lazy_profile(self): return get_profile(self.user)