mirror of
https://github.com/django-components/django-components.git
synced 2025-11-02 16:21:18 +00:00
refactor: Update docs and tests to use get_template_data() (#1161)
* refactor: update docs and tests to use get_template_data() * refactor: fix linting * docs: add note about difference between the two methods
This commit is contained in:
parent
c69980493d
commit
28b61c1609
69 changed files with 795 additions and 725 deletions
|
|
@ -142,7 +142,7 @@ class TestComponentTyping:
|
|||
css_data_instance = None
|
||||
|
||||
class Button(Component):
|
||||
# Data returned from `get_context_data`
|
||||
# Data returned from `get_template_data`
|
||||
@dataclass
|
||||
class TemplateData:
|
||||
data1: str
|
||||
|
|
@ -232,7 +232,7 @@ class TestComponentTyping:
|
|||
css_data_instance = None
|
||||
|
||||
class Button(Component):
|
||||
# Data returned from `get_context_data`
|
||||
# Data returned from `get_template_data`
|
||||
@dataclass
|
||||
class TemplateData:
|
||||
data1: str
|
||||
|
|
@ -348,7 +348,7 @@ class TestComponentTyping:
|
|||
# The generic specifies the data available to the slot function
|
||||
footer: NotRequired[Slot[ButtonFooterSlotData]]
|
||||
|
||||
# Data returned from `get_context_data`
|
||||
# Data returned from `get_template_data`
|
||||
class TemplateData(NamedTuple):
|
||||
data1: str
|
||||
data2: int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue