File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ from datetime import datetime
2+ from django .utils import timezone
3+ from django_unicorn .components import UnicornView
4+
5+ class TestDatetimeView (UnicornView ):
6+ dt : datetime = None
7+
8+ def mount (self ):
9+ self .dt = timezone .now ()
10+
11+ def foo (self ):
12+ pass
Original file line number Diff line number Diff line change 1+ {% load unicorn %}
2+ < div >
3+ < div style ="width:200px;height:200px;margin:10px;background-color:#aaffaa " unicorn:click ="foo() ">
4+ {{ dt }}< br >
5+ (click me)
6+ </ div >
7+ </ div >
Original file line number Diff line number Diff line change 1+ {% extends "www/base.html" %}
2+ {% load static unicorn %}
3+
4+ {% block content %}
5+
6+ < h2 > Test Datetime</ h2 >
7+
8+ {% unicorn 'test-datetime' %}
9+
10+ {% endblock content %}
You can’t perform that action at this time.
0 commit comments