When I set an attribute dynamically via a @property attribute and also add it to javascript_exclude, the request is no longer accessible from self.
Here's the minimal amount of code to reproduce:
class Example(UnicornView):
class Meta:
javascript_exclude = (
"user_id",
)
@property
def user_id(self):
return self.request.user.id
This is a silly example (since request.user.id is already accessible in the template). In a real-world example, I would use the request.user within a property to grab things like user settings and/or database objects related to user + add extra python logic.
Is there a way to implement this?