Skip to content

Commit

Permalink
request: add shortcut to request.connection.interactive
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Scherf <[email protected]>
  • Loading branch information
fscherf committed Aug 26, 2021
1 parent 3b5ee50 commit 79cb153
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/content/end-user-documentation/views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ Attributes
.. table::

^Name ^Description
|interactive |(Bool) Is true when the request came in over an websocket connection
|method |(String) Contains either 'GET' or 'POST'
|GET |(Dict) Contains the URL query
|POST |(Dict) Contains POST arguments. Empty in case of GET requests
Expand Down
4 changes: 4 additions & 0 deletions lona/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def __init__(self, view_runtime, connection):

self.method = 'POST' if self.POST else 'GET'

@property
def interactive(self):
return self.connection.interactive

@property
def user(self):
return getattr(self.connection, 'user', None)
Expand Down

0 comments on commit 79cb153

Please sign in to comment.