mirror of
https://github.com/django-components/django-components.git
synced 2025-12-09 22:11:06 +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
|
|
@ -1,5 +1,3 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
from django_components import Component, register
|
||||
|
||||
|
||||
|
|
@ -10,5 +8,5 @@ class AppLvlCompComponent(Component):
|
|||
{{ variable }}
|
||||
"""
|
||||
|
||||
def get_context_data(self, variable, *args, **kwargs) -> Dict[str, Any]:
|
||||
return {"variable": variable}
|
||||
def get_template_data(self, args, kwargs, slots, context):
|
||||
return {"variable": kwargs["variable"]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue