get request.session from a model method in django
Posted
by dotty
on Stack Overflow
See other posts from Stack Overflow
or by dotty
Published on 2010-06-02T10:58:40Z
Indexed on
2010/06/02
11:13 UTC
Read the original article
Hit count: 281
Hay, is it possible to a get a request.session value from a model method in django?
Here is what i need
def html(self):
Template = loader.get_template("inclusions/Template")
return Template.render(Context({
'user_id':request.session['user'].id
}))
user_id would be request.session['user'].id
© Stack Overflow or respective owner