diff options
Diffstat (limited to 'docs/topics/http')
| -rw-r--r-- | docs/topics/http/sessions.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt index 797b49ffa2..6070b3e4ef 100644 --- a/docs/topics/http/sessions.txt +++ b/docs/topics/http/sessions.txt @@ -191,6 +191,17 @@ You can edit it multiple times. Example: ``'fav_color' in request.session`` + .. method:: __bool__() + + .. versionadded:: 6.1 + + Returns the inverse of :meth:`is_empty`. This allows checking if a + session has data:: + + if request.session: + # Session has data or a key + pass + .. method:: get(key, default=None) .. method:: aget(key, default=None) |
