Django Book 翻译
菜单>:
TOC
返回
原文:
When ``SessionMiddleware`` is activated, each ``HttpRequest`` objectthe first argument to any Django view functionwill have a ``session`` attribute, which is a dictionary-like object. You can read it and write to it in the same way youd use a normal dictionary. For example, in a view you could do stuff like this:
翻译:
``SessionMiddleware`` 激活后,每个传给视图(view)函数的第一个参数``HttpRequest`` 对象都有一个 ``session`` 属性,这是一个字典型的对象。你可以象用普通字典一样来用它。例如,在视图(view)中你可以这样用:
备注:
译者: