Use list instead of tuple to avoid errors with missing comma.

This commit is contained in:
Emil Stenström 2019-11-23 19:26:16 +01:00
parent 8abf8c5e3b
commit ebb180c540
4 changed files with 5 additions and 5 deletions

View file

@ -90,8 +90,8 @@ class Calendar(component.Component):
class Media:
template = "[your app]/components/calendar/calendar.html"
css = {'all': ('[your app]/components/calendar/calendar.css',)}
js = ('[your app]/components/calendar/calendar.js',)
css = {'all': ['[your app]/components/calendar/calendar.css']}
js = ['[your app]/components/calendar/calendar.js']
component.registry.register(name="calendar", component=Calendar)
```

View file

@ -26,7 +26,7 @@ class Component(object):
class Media:
template = None
css = {}
js = ()
js = []
# This variable represents the global component registry
registry = ComponentRegistry()

View file

@ -12,7 +12,7 @@ class SimpleComponent(component.Component):
class Media:
template = "simple_template.html"
css = {"all": "style.css"}
js = ("script.js",)
js = ["script.js"]
class ComponentRegistryTest(unittest.TestCase):
def test_simple_component(self):

View file

@ -13,7 +13,7 @@ class SimpleComponent(component.Component):
class Media:
template = "simple_template.html"
css = {"all": "style.css"}
js = ("script.js",)
js = ["script.js"]
class ComponentTemplateTagTest(unittest.TestCase):
def setUp(self):