mirror of
https://github.com/django-components/django-components.git
synced 2025-08-31 03:07:19 +00:00
refactor: change component typing from generics to class attributes (#1138)
This commit is contained in:
parent
912d8e8074
commit
b49002b545
25 changed files with 2451 additions and 610 deletions
|
@ -15,7 +15,7 @@ Example:
|
|||
class Table(Component):
|
||||
def get_context_data(self, *args, **attrs):
|
||||
# Access component's ID
|
||||
assert self.id == "djc1A2b3c"
|
||||
assert self.id == "c1A2b3c"
|
||||
|
||||
# Access component's inputs, slots and context
|
||||
assert self.input.args == (123, "str")
|
||||
|
@ -66,7 +66,7 @@ If you need to expand this limit, please open an issue on GitHub.
|
|||
class Table(Component):
|
||||
def get_context_data(self, *args, **attrs):
|
||||
# Access component's ID
|
||||
assert self.id == "djc1A2b3c"
|
||||
assert self.id == "c1A2b3c"
|
||||
|
||||
return {}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue