builder
django_spire.core.management.commands.spire_startapp_pkg.builder
TemplateBuilder
Builds and displays tree structures for app and template creation.
This class generates visual representations of the file structure that will be created for new apps and their associated templates.
Initializes the TemplateBuilder with a reporter for output.
Parameters:
-
reporter(Reporter) –Reporter instance for displaying output to the user.
Source code in django_spire/core/management/commands/spire_startapp_pkg/builder.py
build_app_tree_structure
Displays a tree structure of the app files that will be created.
This method shows the user what Python files, directories, and modules will be generated for the new Django app before creation.
Parameters:
-
base(Path) –Base directory where the app will be created.
-
components(list[str]) –List of app path components (e.g., ['app', 'human_resource', 'employee']).
-
registry(list[str]) –List of already registered apps in the Django project.
-
template(Path) –Path to the app template directory.
Source code in django_spire/core/management/commands/spire_startapp_pkg/builder.py
build_html_tree_structure
Displays a tree structure of the HTML template files that will be created.
This method shows the user what HTML templates, cards, forms, and pages will be generated for the new Django app before creation.
Parameters:
-
base(Path) –Base directory where templates will be created.
-
components(list[str]) –List of app path components.
-
registry(list[str]) –List of already registered apps in the Django project.
-
template(Path) –Path to the HTML template directory.