mirror of
https://github.com/django-components/django-components.git
synced 2025-08-03 22:08:17 +00:00
refactor: rename template_name to template_file (#878)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
b99e32e9d5
commit
d94a459c8d
29 changed files with 251 additions and 138 deletions
|
@ -23,7 +23,7 @@ from django_components import Component, register
|
|||
|
||||
@register("calendar")
|
||||
class Calendar(Component):
|
||||
template_name = "calendar.html"
|
||||
template_file = "calendar.html"
|
||||
...
|
||||
def get_context_data(self):
|
||||
return {
|
||||
|
@ -71,7 +71,7 @@ from django_components import Component, register
|
|||
|
||||
@register("calendar")
|
||||
class Calendar(Component):
|
||||
template_name = "calendar.html"
|
||||
template_file = "calendar.html"
|
||||
...
|
||||
def get_context_data(self, date: date, extra_class: str | None = None):
|
||||
return {
|
||||
|
@ -135,7 +135,7 @@ We need to group the list items by size into following buckets by population:
|
|||
|
||||
- 0-10,000,000
|
||||
- 10,000,001-20,000,000
|
||||
- 20,000,001-30,000,000
|
||||
- 20,000,001-30,000,000
|
||||
- +30,000,001
|
||||
|
||||
So we want to end up with following data:
|
||||
|
@ -179,7 +179,7 @@ def group_by_pop(data):
|
|||
|
||||
@register("population_table")
|
||||
class PopulationTable(Component):
|
||||
template_name = "population_table.html"
|
||||
template_file = "population_table.html"
|
||||
|
||||
def get_context_data(self, data):
|
||||
return {
|
||||
|
@ -200,7 +200,7 @@ def to_workweek_date(d: date):
|
|||
|
||||
@register("calendar")
|
||||
class Calendar(Component):
|
||||
template_name = "calendar.html"
|
||||
template_file = "calendar.html"
|
||||
...
|
||||
def get_context_data(self, date: date, extra_class: str | None = None):
|
||||
workweek_date = to_workweek_date(date) # <--- new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue