mirror of
https://github.com/django-components/django-components.git
synced 2025-09-26 15:39:08 +00:00
Use list instead of tuple to avoid errors with missing comma.
This commit is contained in:
parent
8abf8c5e3b
commit
ebb180c540
4 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
```
|
||||
|
|
|
@ -26,7 +26,7 @@ class Component(object):
|
|||
class Media:
|
||||
template = None
|
||||
css = {}
|
||||
js = ()
|
||||
js = []
|
||||
|
||||
# This variable represents the global component registry
|
||||
registry = ComponentRegistry()
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue