You can get the request
object from self.context
. So if you only need request.user
, that's one way to do it.
class OwnedTable(tables.Table):
roles = tables.Column(empty_values=())
def render_roles(self):
user = self.context["request"].user
...
Otherwise, @mariodev's solution works.