mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 06:18:17 +00:00
fix(context): change context template in the template file and rename context dict keys with default values.
This commit is contained in:
parent
ba436c0080
commit
4753698765
1 changed files with 4 additions and 2 deletions
|
@ -126,6 +126,8 @@ class Command(BaseCommand):
|
|||
f"""
|
||||
<div class="component-{name}">
|
||||
Hello from {name} component!
|
||||
<br>
|
||||
This is {{ param }} context value.
|
||||
</div>
|
||||
"""
|
||||
)
|
||||
|
@ -142,9 +144,9 @@ class Command(BaseCommand):
|
|||
class {name.capitalize()}(component.Component):
|
||||
template_name = "{name}/{template_filename}"
|
||||
|
||||
def get_context_data(self, date):
|
||||
def get_context_data(self, value):
|
||||
return {{
|
||||
"date": date,
|
||||
"param": "sample value",
|
||||
}}
|
||||
|
||||
class Media:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue