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:
Juro Oravec 2024-09-14 22:47:30 +02:00 committed by GitHub
parent 6b3c112968
commit ee9b92975a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 218 additions and 112 deletions

View file

View file

View 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"

View 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}