File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1+ default_app_config = "coffee.apps.CoffeeConfig"
Original file line number Diff line number Diff line change 22
33
44class CoffeeConfig (AppConfig ):
5- pass
5+ name = "example.coffee"
Original file line number Diff line number Diff line change 11from django .shortcuts import redirect
22from django .utils .functional import cached_property
33
4- from coffee .models import Flavor
5-
64from django_unicorn .components import HashUpdate , LocationUpdate , UnicornView
75from django_unicorn .db import DbModel
86from django_unicorn .decorators import db_model
7+ from example .coffee .models import Flavor
98
109
1110class ModelsView (UnicornView ):
@@ -14,7 +13,7 @@ class ModelsView(UnicornView):
1413 # Demonstrates how to use an instantiated model; class attributes get stored on
1514 # the class, so django-unicorn handles clearing this with `_resettable_attributes_cache`
1615 # in components.py
17- class_flavor = Flavor ()
16+ class_flavor : Flavor = Flavor ()
1817
1918 def __init__ (self , ** kwargs ):
2019 # Demonstrates how to use an instance variable on the class
@@ -41,6 +40,7 @@ def add_class_flavor(self):
4140 id = self .class_flavor .id
4241 self .reset ()
4342
43+ # Note: this can cause inputs to appear to be cached
4444 return redirect (f"/models?createdId={ id } " )
4545
4646 @db_model
You can’t perform that action at this time.
0 commit comments