mirror of
https://github.com/django-components/django-components.git
synced 2025-08-09 16:57:59 +00:00
fix: autoimport with nested apps (#672)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
6b3c112968
commit
ee9b92975a
13 changed files with 218 additions and 112 deletions
0
tests/test_app_nested/__init__.py
Normal file
0
tests/test_app_nested/__init__.py
Normal file
0
tests/test_app_nested/app/__init__.py
Normal file
0
tests/test_app_nested/app/__init__.py
Normal file
6
tests/test_app_nested/app/apps.py
Normal file
6
tests/test_app_nested/app/apps.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class TestAppNestedConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "tests.test_app_nested.app"
|
0
tests/test_app_nested/app/components/__init__.py
Normal file
0
tests/test_app_nested/app/components/__init__.py
Normal file
14
tests/test_app_nested/app/components/app_lvl_comp.py
Normal file
14
tests/test_app_nested/app/components/app_lvl_comp.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
from django_components import Component, register
|
||||
|
||||
|
||||
# Used for testing the template_loader
|
||||
@register("nested_app_lvl_comp")
|
||||
class AppLvlCompComponent(Component):
|
||||
template = """
|
||||
{{ variable }}
|
||||
"""
|
||||
|
||||
def get_context_data(self, variable, *args, **kwargs) -> Dict[str, Any]:
|
||||
return {"variable": variable}
|
Loading…
Add table
Add a link
Reference in a new issue