I have a proxy model for the user:
class MyUser(User):
class Meta:
proxy = True
How can I get it in templates without going from view? can i only get it from request.user instance?
I use a template context handler for this:
def m_processor(request):
from main.models import MyUser
mu = MyUser.objects.get(id = request.user.id)
return {'meuser':mu}
TEMPLATE_CONTEXT_PROCESSORS = (
'settings.m_processor',
)
Best exsists solution?
source
share