Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions example/unicorn/components/hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ class HelloWorldView(UnicornView):
def set_name(self):
self.name = "set_name method called"
return "set_name called at " + now().strftime("%H:%M:%S.%f")

@property
def user(self):
return self.request.user

class Meta:
javascript_exclude = (
"user",
)
5 changes: 5 additions & 0 deletions example/unicorn/templates/unicorn/hello-world-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<label></label>
<input unicorn:model="name" type="text" id="name" unicorn:key="key1">

<div>
User: {{ user }}
</div>
<br />

Hello, {{ name|default:'World' }}!

<div>
Expand Down