diff --git a/example/unicorn/components/issue_397.py b/example/unicorn/components/issue_397.py new file mode 100644 index 00000000..47599ed0 --- /dev/null +++ b/example/unicorn/components/issue_397.py @@ -0,0 +1,24 @@ +from typing import Dict + +from django_unicorn.components import UnicornView + + +class Issue397View(UnicornView): + counter: int = 1 + counter2: Dict = None + + def mount(self): + self.counter2 = {"more": 8} + + def inc(self): + self.counter += 1 + self.counter2["more"] += 1 + + def updated_counter(self, value): + print(f"updated_counter: {value}") + + def updated_counter2(self, value): + print(f"updated_counter2: {value}") + + def updated(self, name, value): + print(f"updated: {name}, {value}") diff --git a/example/unicorn/templates/unicorn/issue-397.html b/example/unicorn/templates/unicorn/issue-397.html new file mode 100644 index 00000000..fbabc092 --- /dev/null +++ b/example/unicorn/templates/unicorn/issue-397.html @@ -0,0 +1,27 @@ +{% extends "www/base.html" %} +{% load unicorn %} + +{% block content %} + +