falco-cli 0.6.1__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.github/workflows/documentation.yml +2 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.github/workflows/pre-commit-auto-update.yml +1 -1
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.github/workflows/publish.yml +3 -1
- {falco_cli-0.6.1 → falco_cli-0.6.2}/PKG-INFO +1 -1
- falco_cli-0.6.2/blueprints/falco_blueprint_basic/.github/workflows/pre-commit-auto-update.yml +47 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/config/urls.py +1 -3
- falco_cli-0.6.2/demo/templates/products/product_create.html +13 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/templates/products/product_detail.html +2 -13
- falco_cli-0.6.2/demo/templates/products/product_list.html +106 -0
- falco_cli-0.6.2/demo/templates/products/product_update.html +17 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/__about__.py +1 -1
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/__init__.py +2 -2
- falco_cli-0.6.2/src/falco/commands/crud/__init__.py +2 -0
- {falco_cli-0.6.1/src/falco/commands → falco_cli-0.6.2/src/falco/commands/crud}/install_crud_utils.py +4 -4
- {falco_cli-0.6.1/src/falco/commands → falco_cli-0.6.2/src/falco/commands/crud}/model_crud.py +47 -66
- falco_cli-0.6.2/src/falco/commands/crud/utils.py +57 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/start_app.py +1 -1
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/start_project.py +3 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/python/views.py.jinja +3 -3
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_htmx.py +4 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_htmx_extension.py +2 -0
- falco_cli-0.6.1/.github/dependabot.yml +0 -11
- falco_cli-0.6.1/demo/templates/products/product_create.html +0 -15
- falco_cli-0.6.1/demo/templates/products/product_list.html +0 -122
- falco_cli-0.6.1/demo/templates/products/product_update.html +0 -23
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.all-contributorsrc +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.editorconfig +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.gitignore +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.gitmodules +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.pre-commit-config.yaml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/.vscode/settings.json +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/CODE_OF_CONDUCT.md +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/LICENSE +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/README.md +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/all-contributorsrc +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/assets/falco-logo.svg +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/.git +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/.github/workflows/ci.yml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/LICENSE +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/README.md +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/cookiecutter.json +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/.env.template +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/.github/dependabot.yml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/.github/workflows/ci.yml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/.gitignore +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/.pre-commit-config.yaml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/README.md +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/config/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/config/asgi.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/config/settings.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/config/urls.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/config/wsgi.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/deploy/Dockerfile +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/deploy/entrypoint.sh +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/deploy/gunicorn.conf.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/manage.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/playground.ipynb +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/pyproject.toml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/tests/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/tests/test_assert_true.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/core/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/core/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/static/vendors/htmx/htmx.min.js +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/templates/base.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/templates/home.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/admin.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/forms.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/migrations/0001_initial.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/migrations/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/models.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/.git +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/.github/workflows/ci.yml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/LICENSE +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/README.md +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/cookiecutter.json +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/.env.template +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/.github/dependabot.yml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/.github/workflows/ci.yml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/.gitignore +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/.pre-commit-config.yaml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/README.md +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/blueprints/create.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/blueprints/detail.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/blueprints/list.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/blueprints/update.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/config/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/config/asgi.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/config/settings.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/config/urls.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/config/wsgi.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/deploy/Dockerfile +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/deploy/entrypoint.sh +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/deploy/gunicorn.conf.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/manage.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/playground.ipynb +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/pyproject.toml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/tests/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/tests/test_assert_true.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/core/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/core/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/static/vendors/htmx/htmx.min.js +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/templates/base.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/templates/home.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/admin.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/forms.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/migrations/0001_initial.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/migrations/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/blueprints/falco_blueprint_basic_bootstrap/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/users/models.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/config/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/config/asgi.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/config/settings.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/config/wsgi.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/core/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/core/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/core/types.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/core/utils.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/orders/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/orders/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/orders/migrations/0001_initial.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/orders/migrations/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/orders/models.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/admin.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/forms.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/migrations/0001_initial.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/migrations/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/models.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/tests.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/urls.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/products/views.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/users/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/users/admin.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/users/apps.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/users/migrations/0001_initial.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/users/migrations/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/demo/users/models.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/manage.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/pyproject.toml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/requirements.txt +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/demo/templates/base.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/.rich-codex.yml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/Makefile +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/_static/custom.css +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/_templates/partials/globaltoc-above.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/changelog.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/codeofconduct.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/conf.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/contributing.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/avoiding_god_models.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/database_tips.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/deployment.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/dynamic_model_schema.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/index.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/interactive_user_interfaces.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/logging_and_monitoring.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/multitenancy.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/optimizing_database_access.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/permissions_and_authorization.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/realtime.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/running_project_in_a_container.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/task_queues_and_schedulers.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/tips_and_extra.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/use_sqlite_in_production.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/writing_async_code.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/writing_documentation.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/guides/writing_tests.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/images/deployment.png +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/images/logo_with_text.svg +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/images/project-tree.svg +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/images/task_queue.png +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/index.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/install.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/license.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/make.bat +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/crud.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/htmx.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/index.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/migrations.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/setup_admin.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/start_app.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/start_project.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/sync_dotenv.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/docs/the_cli/work.rst +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/pyproject.toml +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/scripts/project_tree.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/scripts/update_readme_guides.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/__main__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/checks.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/htmx.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/htmx_extension.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/reset_migrations.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/rm_migrations.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/setup_admin.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/sync_dotenv.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/commands/work.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/html/create.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/html/detail.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/html/list.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/html/update.html +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/python/forms.py.jinja +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/utils/types.py.jinja +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/crud/utils/utils.py.jinja +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/src/falco/utils.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/__init__.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_crud.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_install_crud_utils.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_reset_migrations.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_rm_migrations.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_setup_admin.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_start_app.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_start_project.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/commands/test_sync_dotenv.py +0 -0
- {falco_cli-0.6.1 → falco_cli-0.6.2}/tests/conftest.py +0 -0
|
@@ -12,6 +12,8 @@ jobs:
|
|
|
12
12
|
python-version: ["3.10", "3.11", "3.12"]
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/checkout@v3
|
|
15
|
+
with:
|
|
16
|
+
submodules: recursive
|
|
15
17
|
- name: Set up Python ${{ matrix.python-version }}
|
|
16
18
|
uses: actions/setup-python@v5
|
|
17
19
|
with:
|
|
@@ -45,4 +47,4 @@ jobs:
|
|
|
45
47
|
run: |
|
|
46
48
|
hatch build
|
|
47
49
|
- name: Publish
|
|
48
|
-
uses: pypa/gh-action-pypi-publish@release/v1
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: falco-cli
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Enhance your Django developer experience: CLI and Guides for the Modern Developer.
|
|
5
5
|
Project-URL: Homepage, https://falco.oluwatobi.dev/
|
|
6
6
|
Project-URL: Documentation, https://falco.oluwatobi.dev/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Run pre-commit autoupdate every day at midnight
|
|
2
|
+
# and create a pull request if any changes
|
|
3
|
+
|
|
4
|
+
name: Pre-commit auto-update
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: "15 2 * * *"
|
|
9
|
+
workflow_dispatch: # to trigger manually
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
auto-update:
|
|
16
|
+
# Disables this workflow from running in a repository that is not part of the indicated organization/user
|
|
17
|
+
if: github.repository_owner == 'Tobi-De'
|
|
18
|
+
permissions:
|
|
19
|
+
contents: write # for peter-evans/create-pull-request to create branch
|
|
20
|
+
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
|
21
|
+
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: actions/setup-python@v4
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.11"
|
|
28
|
+
|
|
29
|
+
- name: Install pre-commit
|
|
30
|
+
run: pip install pre-commit
|
|
31
|
+
|
|
32
|
+
- name: Autoupdate template
|
|
33
|
+
run: pre-commit autoupdate
|
|
34
|
+
|
|
35
|
+
- name: Autoupdate generated projects
|
|
36
|
+
working-directory: "{{ cookiecutter.project_name }}"
|
|
37
|
+
run: pre-commit autoupdate
|
|
38
|
+
|
|
39
|
+
- name: Create Pull Request
|
|
40
|
+
uses: peter-evans/create-pull-request@v5
|
|
41
|
+
with:
|
|
42
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
+
branch: update/pre-commit-autoupdate
|
|
44
|
+
title: Auto-update pre-commit hooks
|
|
45
|
+
commit-message: Auto-update pre-commit hooks
|
|
46
|
+
body: Update versions of tools in pre-commit configs to latest version
|
|
47
|
+
labels: update
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% load crispy_forms_tags %}
|
|
3
|
+
{% block content %}
|
|
4
|
+
<h1 class="text-lg font-bold py-4">Create Product</h1>
|
|
5
|
+
<form method="post">
|
|
6
|
+
{% csrf_token %}
|
|
7
|
+
{{ form|crispy }}
|
|
8
|
+
<button type="submit"
|
|
9
|
+
class="cursor-pointer py-2 px-4 bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 focus:ring-offset-blue-200 text-white text-center text-base font-semibold focus:outline-none focus:ring-2 focus:ring-offset-2 rounded-lg">
|
|
10
|
+
Save
|
|
11
|
+
</button>
|
|
12
|
+
</form>
|
|
13
|
+
{% endblock content %}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
{% extends "base.html" %}
|
|
2
|
-
|
|
3
2
|
{% block content %}
|
|
4
|
-
|
|
5
3
|
<section class="flex justify-between">
|
|
6
4
|
<h1 class="text-lg font-bold">Product - {{ product }}</h1>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
All Products
|
|
10
|
-
</a>
|
|
5
|
+
<a href="{% url 'products:product_list' %}"
|
|
6
|
+
class="text-blue-600 hover:underline hover:text-blue-500">All Products</a>
|
|
11
7
|
</section>
|
|
12
|
-
|
|
13
|
-
|
|
14
8
|
<ul class="py-5">
|
|
15
9
|
<li>
|
|
16
10
|
<span class="font-bold">Name:</span> {{ product.name }}
|
|
@@ -28,11 +22,6 @@
|
|
|
28
22
|
<span class="font-bold">Sku:</span> {{ product.sku }}
|
|
29
23
|
</li>
|
|
30
24
|
</ul>
|
|
31
|
-
|
|
32
|
-
|
|
33
25
|
<a class="py-2 px-4 bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 focus:ring-offset-blue-200 text-white text-center text-base font-semibold focus:outline-none focus:ring-2 focus:ring-offset-2 rounded-lg"
|
|
34
26
|
href="{% url 'products:product_update' product.pk %}">Edit</a>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
27
|
{% endblock content %}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{% extends 'base.html' %}
|
|
2
|
+
{% load partials %}
|
|
3
|
+
{% block content %}
|
|
4
|
+
<section class="flex justify-between">
|
|
5
|
+
<h1 class="text-lg font-bold">Products</h1>
|
|
6
|
+
<a href="{% url 'products:product_create' %}"
|
|
7
|
+
class="cursor-pointer py-2 px-4 bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 focus:ring-offset-blue-200 text-white text-center text-base font-semibold focus:outline-none focus:ring-2 focus:ring-offset-2 rounded-lg">
|
|
8
|
+
New Product
|
|
9
|
+
</a>
|
|
10
|
+
</section>
|
|
11
|
+
{% partialdef table inline=True %}
|
|
12
|
+
<div id="table">
|
|
13
|
+
<div class="flex flex-col">
|
|
14
|
+
<div class="overflow-x-auto sm:-mx-6 lg:-mx-8">
|
|
15
|
+
<div class="py-2 inline-block min-w-full sm:px-6 lg:px-8">
|
|
16
|
+
<div class="overflow-x-auto">
|
|
17
|
+
<table class="min-w-full">
|
|
18
|
+
<thead class="border">
|
|
19
|
+
{% with th_class="text-sm font-medium text-gray-900 border-r px-6 py-4 text-left" %}
|
|
20
|
+
<tr>
|
|
21
|
+
<th scope="col" class="{{ th_class }}">Name</th>
|
|
22
|
+
<th scope="col" class="{{ th_class }}">Description</th>
|
|
23
|
+
<th scope="col" class="{{ th_class }}">Price</th>
|
|
24
|
+
<th scope="col" class="{{ th_class }}">Slug</th>
|
|
25
|
+
<th scope="col" class="{{ th_class }}">Sku</th>
|
|
26
|
+
<th scope="col" class="{{ th_class }}">Actions</th>
|
|
27
|
+
</tr>
|
|
28
|
+
{% endwith %}
|
|
29
|
+
</thead>
|
|
30
|
+
<tbody>
|
|
31
|
+
{% with td_class="px-6 py-4 whitespace-nowrap text-sm font-medium border-r text-gray-900" %}
|
|
32
|
+
{% for product in products_page %}
|
|
33
|
+
<tr class="border">
|
|
34
|
+
<td class="{{ td_class }}">{{ product.name }}</td>
|
|
35
|
+
<td class="{{ td_class }}">{{ product.description }}</td>
|
|
36
|
+
<td class="{{ td_class }}">{{ product.price }}</td>
|
|
37
|
+
<td class="{{ td_class }}">{{ product.slug }}</td>
|
|
38
|
+
<td class="{{ td_class }}">{{ product.sku }}</td>
|
|
39
|
+
<td class="{{ td_class }}">
|
|
40
|
+
{% with href_class="text-blue-600 hover:underline hover:text-blue-500" %}
|
|
41
|
+
<a class="{{ href_class }}}"
|
|
42
|
+
href="{% url 'products:product_detail' product.pk %}">View</a>|
|
|
43
|
+
<a class="{{ href_class }}}"
|
|
44
|
+
href="{% url 'products:product_update' product.pk %}">Edit</a>|
|
|
45
|
+
<a class="cursor-pointer {{ href_class }}"
|
|
46
|
+
hx-target="closest tr"
|
|
47
|
+
hx-swap="outerHTML"
|
|
48
|
+
hx-confirm="Are you sure you want to delete {{ product }}?"
|
|
49
|
+
hx-delete="{% url 'products:product_delete' product.pk %}">
|
|
50
|
+
Delete
|
|
51
|
+
</a>
|
|
52
|
+
</td>
|
|
53
|
+
</tr>
|
|
54
|
+
{% endwith %}
|
|
55
|
+
{% endfor %}
|
|
56
|
+
{% endwith %}
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
{% if products_page.paginator.num_pages > 1 %}
|
|
64
|
+
<div class="flex justify-end py-4">
|
|
65
|
+
<ul class="flex list-reset border border-grey-light rounded"
|
|
66
|
+
hx-target="#table"
|
|
67
|
+
hx-swap="outerHTML"
|
|
68
|
+
hx-push-url="true">
|
|
69
|
+
{% with page_class="cursor-pointer block px-3 py-2 hover:text-white hover:bg-blue-500 border-r border-grey-light" %}
|
|
70
|
+
{% if products_page.has_previous %}
|
|
71
|
+
<li>
|
|
72
|
+
<a class="{{ page_class }}}" hx-get="?page=1">First</a>
|
|
73
|
+
</li>
|
|
74
|
+
<li>
|
|
75
|
+
<a class="{{ page_class }}}"
|
|
76
|
+
hx-get="?page={{ products_page.previous_page_number }}">Previous</a>
|
|
77
|
+
</li>
|
|
78
|
+
{% endif %}
|
|
79
|
+
{% for num in products_page.paginator.page_range %}
|
|
80
|
+
{% if products_page.number == num %}
|
|
81
|
+
<li>
|
|
82
|
+
<a class="{{ page_class }}}" hx-get="?page={{ num }}">{{ num }}</a>
|
|
83
|
+
</li>
|
|
84
|
+
{% elif num > products_page.number|add:'-3' and num < products_page.number|add:'3' %}
|
|
85
|
+
<li>
|
|
86
|
+
<a class="{{ page_class }}}" hx-get="?page={{ num }}">{{ num }}</a>
|
|
87
|
+
</li>
|
|
88
|
+
{% endif %}
|
|
89
|
+
{% endfor %}
|
|
90
|
+
{% if products_page.has_next %}
|
|
91
|
+
<li>
|
|
92
|
+
<a class="{{ page_class }}"
|
|
93
|
+
hx-get="?page={{ products_page.next_page_number }}">Next</a>
|
|
94
|
+
</li>
|
|
95
|
+
<li>
|
|
96
|
+
<a class="cursor-pointer block px-3 py-2 hover:text-white hover:bg-blue-500"
|
|
97
|
+
hx-get="?page={{ products_page.paginator.num_pages }}">Last</a>
|
|
98
|
+
</li>
|
|
99
|
+
{% endif %}
|
|
100
|
+
{% endwith %}
|
|
101
|
+
</ul>
|
|
102
|
+
</div>
|
|
103
|
+
{% endif %}
|
|
104
|
+
</div>
|
|
105
|
+
{% endpartialdef %}
|
|
106
|
+
{% endblock %}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
{% load crispy_forms_tags %}
|
|
3
|
+
{% block content %}
|
|
4
|
+
<section class="flex justify-between">
|
|
5
|
+
<h1 class="text-lg font-bold py-4">Update {{ product }}</h1>
|
|
6
|
+
<a href="{% url 'products:product_list' %}"
|
|
7
|
+
class="text-blue-600 hover:underline hover:text-blue-500">All Products</a>
|
|
8
|
+
</section>
|
|
9
|
+
<form method="post">
|
|
10
|
+
{% csrf_token %}
|
|
11
|
+
{{ form|crispy }}
|
|
12
|
+
<button type="submit"
|
|
13
|
+
class="cursor-pointer py-2 px-4 bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 focus:ring-offset-blue-200 text-white text-center text-base font-semibold focus:outline-none focus:ring-2 focus:ring-offset-2 rounded-lg">
|
|
14
|
+
Save
|
|
15
|
+
</button>
|
|
16
|
+
</form>
|
|
17
|
+
{% endblock content %}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
from .crud import InstallCrudUtils # noqa
|
|
2
|
+
from .crud import ModelCRUD # noqa
|
|
1
3
|
from .htmx import Htmx # noqa
|
|
2
4
|
from .htmx_extension import HtmxExtension # noqa
|
|
3
|
-
from .install_crud_utils import InstallCrudUtils # noqa
|
|
4
|
-
from .model_crud import ModelCRUD # noqa
|
|
5
5
|
from .reset_migrations import ResetMigrations # noqa
|
|
6
6
|
from .rm_migrations import RmMigrations # noqa
|
|
7
7
|
from .setup_admin import SetupAdmin # noqa
|
{falco_cli-0.6.1/src/falco/commands → falco_cli-0.6.2/src/falco/commands/crud}/install_crud_utils.py
RENAMED
|
@@ -9,10 +9,10 @@ from falco.utils import simple_progress
|
|
|
9
9
|
from falco.utils import write_falco_config
|
|
10
10
|
from rich import print as rich_print
|
|
11
11
|
|
|
12
|
-
from .
|
|
13
|
-
from .
|
|
14
|
-
from .
|
|
15
|
-
from .
|
|
12
|
+
from .utils import extract_python_file_templates
|
|
13
|
+
from .utils import get_crud_blueprints_path
|
|
14
|
+
from .utils import render_to_string
|
|
15
|
+
from .utils import run_python_formatters
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@cappa.command(help="Install utils necessary for CRUD views.", name="install-crud-utils")
|
{falco_cli-0.6.1/src/falco/commands → falco_cli-0.6.2/src/falco/commands/crud}/model_crud.py
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import importlib
|
|
2
1
|
import subprocess
|
|
3
2
|
from pathlib import Path
|
|
4
3
|
from typing import Annotated
|
|
@@ -8,18 +7,21 @@ from typing import TypedDict
|
|
|
8
7
|
import cappa
|
|
9
8
|
import parso
|
|
10
9
|
from falco.utils import get_project_name
|
|
10
|
+
from falco.utils import read_falco_config
|
|
11
11
|
from falco.utils import RICH_ERROR_MARKER
|
|
12
|
+
from falco.utils import RICH_INFO_MARKER
|
|
13
|
+
from falco.utils import RICH_SUCCESS_MARKER
|
|
12
14
|
from falco.utils import run_in_shell
|
|
13
15
|
from falco.utils import simple_progress
|
|
14
|
-
from jinja2 import Template
|
|
15
16
|
from rich import print as rich_print
|
|
16
17
|
|
|
17
|
-
from
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
from .. import checks
|
|
19
|
+
from .install_crud_utils import InstallCrudUtils
|
|
20
|
+
from .utils import extract_python_file_templates
|
|
21
|
+
from .utils import get_crud_blueprints_path
|
|
22
|
+
from .utils import render_to_string
|
|
23
|
+
from .utils import run_html_formatters
|
|
24
|
+
from .utils import run_python_formatters
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
class PythonBlueprintContext(TypedDict):
|
|
@@ -30,6 +32,7 @@ class PythonBlueprintContext(TypedDict):
|
|
|
30
32
|
model_verbose_name_plural: str
|
|
31
33
|
model_fields: dict[str, str]
|
|
32
34
|
excluded_fields: list[str]
|
|
35
|
+
crud_utils_import: str
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
class UrlsForContext(TypedDict):
|
|
@@ -45,7 +48,7 @@ class HtmlBlueprintContext(UrlsForContext):
|
|
|
45
48
|
model_name: str
|
|
46
49
|
model_verbose_name_plural: str
|
|
47
50
|
model_fields: dict[str, str]
|
|
48
|
-
# a example of the dict: {"Name": "product.name", "Price": "{{product.price}}"}
|
|
51
|
+
# a example of the dict: {"Name": "{{product.name}}", "Price": "{{product.price}}"}
|
|
49
52
|
fields_verbose_name_with_accessor: dict[str, str]
|
|
50
53
|
|
|
51
54
|
|
|
@@ -84,12 +87,6 @@ print(root_urlconf)
|
|
|
84
87
|
"""
|
|
85
88
|
|
|
86
89
|
|
|
87
|
-
def extract_content_from(text: str, start_comment: str, end_comment: str):
|
|
88
|
-
start_index = text.find(start_comment) + len(start_comment)
|
|
89
|
-
end_index = text.find(end_comment)
|
|
90
|
-
return text[start_index:end_index]
|
|
91
|
-
|
|
92
|
-
|
|
93
90
|
def get_urls(model_name_lower: str, urlsafe_model_verbose_name_plural: str) -> str:
|
|
94
91
|
prefix = urlsafe_model_verbose_name_plural
|
|
95
92
|
return f"""
|
|
@@ -111,44 +108,6 @@ def get_urls_template_string(app_label: str, model_name_lower: str) -> UrlsForCo
|
|
|
111
108
|
}
|
|
112
109
|
|
|
113
110
|
|
|
114
|
-
def render_to_string(template_content: str, context: dict):
|
|
115
|
-
return Template(template_content).render(**context)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def get_crud_blueprints_path() -> Path:
|
|
119
|
-
package = importlib.util.find_spec("falco")
|
|
120
|
-
if package is None:
|
|
121
|
-
raise cappa.Exit("The falco base install path could not be found.", code=1)
|
|
122
|
-
return Path(package.submodule_search_locations[0]) / "crud"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
@simple_progress("Running python formatters")
|
|
126
|
-
def run_python_formatters(filepath: str):
|
|
127
|
-
autoflake = [
|
|
128
|
-
"autoflake",
|
|
129
|
-
"--in-place",
|
|
130
|
-
"--remove-all-unused-imports",
|
|
131
|
-
filepath,
|
|
132
|
-
]
|
|
133
|
-
black = ["black", filepath]
|
|
134
|
-
isort = ["isort", filepath]
|
|
135
|
-
subprocess.run(autoflake, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
136
|
-
subprocess.run(isort, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
137
|
-
subprocess.run(black, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
@simple_progress("Running html formatters")
|
|
141
|
-
def run_html_formatters(filepath: str):
|
|
142
|
-
djlint = ["djlint", filepath, "--reformat"]
|
|
143
|
-
subprocess.run(djlint, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
def extract_python_file_templates(file_content: str) -> tuple[str, str]:
|
|
147
|
-
imports_template = extract_content_from(file_content, IMPORT_START_COMMENT, IMPORT_END_COMMENT)
|
|
148
|
-
code_template = extract_content_from(file_content, CODE_START_COMMENT, CODE_END_COMMENT)
|
|
149
|
-
return imports_template, code_template
|
|
150
|
-
|
|
151
|
-
|
|
152
111
|
def initial_urls_content(app_label: str, urls_content: str) -> str:
|
|
153
112
|
return f"""
|
|
154
113
|
from django.urls import path
|
|
@@ -196,7 +155,10 @@ def register_models_in_admin(app_folder_path: Path, app_label: str, model_name:
|
|
|
196
155
|
cmd_args.append(model_name)
|
|
197
156
|
|
|
198
157
|
result = subprocess.run(
|
|
199
|
-
["python", "manage.py", "admin_generator", *cmd_args],
|
|
158
|
+
["python", "manage.py", "admin_generator", *cmd_args],
|
|
159
|
+
capture_output=True,
|
|
160
|
+
text=True,
|
|
161
|
+
check=False,
|
|
200
162
|
)
|
|
201
163
|
if result.returncode != 0:
|
|
202
164
|
msg = result.stderr.split("\n")[-2]
|
|
@@ -244,7 +206,12 @@ class ModelCRUD:
|
|
|
244
206
|
]
|
|
245
207
|
excluded_fields: Annotated[
|
|
246
208
|
list[str],
|
|
247
|
-
cappa.Arg(
|
|
209
|
+
cappa.Arg(
|
|
210
|
+
short=True,
|
|
211
|
+
default=[],
|
|
212
|
+
long="--exclude",
|
|
213
|
+
help="Fields to exclude from the form.",
|
|
214
|
+
),
|
|
248
215
|
]
|
|
249
216
|
only_python: Annotated[
|
|
250
217
|
bool,
|
|
@@ -316,6 +283,13 @@ class ModelCRUD:
|
|
|
316
283
|
|
|
317
284
|
python_blueprint_context: list[PythonBlueprintContext] = []
|
|
318
285
|
html_blueprint_context: list[HtmlBlueprintContext] = []
|
|
286
|
+
pyproject_path = Path("pyproject.toml")
|
|
287
|
+
falco_config = read_falco_config(pyproject_path=pyproject_path) if pyproject_path.exists() else {}
|
|
288
|
+
install_path, crud_utils_installed = InstallCrudUtils.get_install_path(
|
|
289
|
+
project_name=project_name,
|
|
290
|
+
falco_config=falco_config,
|
|
291
|
+
)
|
|
292
|
+
crud_utils_import = str(install_path).replace("/", ".")
|
|
319
293
|
for django_model in django_models:
|
|
320
294
|
python_blueprint_context.append(
|
|
321
295
|
{
|
|
@@ -326,8 +300,10 @@ class ModelCRUD:
|
|
|
326
300
|
"model_verbose_name_plural": django_model["verbose_name_plural"],
|
|
327
301
|
"model_fields": django_model["fields"],
|
|
328
302
|
"excluded_fields": excluded_fields,
|
|
303
|
+
"crud_utils_import": crud_utils_import,
|
|
329
304
|
}
|
|
330
305
|
)
|
|
306
|
+
model_name_lower = django_model["name"].lower()
|
|
331
307
|
html_blueprint_context.append(
|
|
332
308
|
{
|
|
333
309
|
"app_label": app_label,
|
|
@@ -335,8 +311,8 @@ class ModelCRUD:
|
|
|
335
311
|
"model_verbose_name_plural": django_model["verbose_name_plural"],
|
|
336
312
|
"model_fields": django_model["fields"],
|
|
337
313
|
"fields_verbose_name_with_accessor": {
|
|
338
|
-
|
|
339
|
-
for
|
|
314
|
+
verbose_name: "{{" + f"{model_name_lower}.{name}" + "}}"
|
|
315
|
+
for name, verbose_name in django_model["fields"].items()
|
|
340
316
|
},
|
|
341
317
|
**get_urls_template_string(
|
|
342
318
|
app_label=app_label,
|
|
@@ -372,9 +348,9 @@ class ModelCRUD:
|
|
|
372
348
|
updated_html_files = set()
|
|
373
349
|
if not self.only_python:
|
|
374
350
|
html_blueprints = (
|
|
375
|
-
list((
|
|
376
|
-
if
|
|
377
|
-
else list(
|
|
351
|
+
list(Path(self.blueprints).glob("*.html"))
|
|
352
|
+
if self.blueprints
|
|
353
|
+
else list((get_crud_blueprints_path() / "html").iterdir())
|
|
378
354
|
)
|
|
379
355
|
|
|
380
356
|
updated_html_files.update(
|
|
@@ -393,11 +369,12 @@ class ModelCRUD:
|
|
|
393
369
|
run_html_formatters(str(file))
|
|
394
370
|
|
|
395
371
|
display_names = ", ".join(m.get("name") for m in django_models)
|
|
396
|
-
rich_print(f"
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
372
|
+
rich_print(f"{RICH_SUCCESS_MARKER}CRUD views generated for: {display_names}[/green]")
|
|
373
|
+
if not crud_utils_installed:
|
|
374
|
+
rich_print(
|
|
375
|
+
f"{RICH_INFO_MARKER}It appears that your CRUD utilities have not been installed yet. "
|
|
376
|
+
f"Please execute the command 'falco install-crud-utils' to install them."
|
|
377
|
+
)
|
|
401
378
|
|
|
402
379
|
@simple_progress("Generating python code")
|
|
403
380
|
def generate_python_code(
|
|
@@ -434,7 +411,11 @@ class ModelCRUD:
|
|
|
434
411
|
|
|
435
412
|
model_name = contexts[0]["model_name"] if len(contexts) == 1 else None
|
|
436
413
|
updated_files.append(
|
|
437
|
-
register_models_in_admin(
|
|
414
|
+
register_models_in_admin(
|
|
415
|
+
app_folder_path=app_folder_path,
|
|
416
|
+
app_label=app_label,
|
|
417
|
+
model_name=model_name,
|
|
418
|
+
)
|
|
438
419
|
)
|
|
439
420
|
return updated_files
|
|
440
421
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import importlib
|
|
2
|
+
import subprocess
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import cappa
|
|
6
|
+
from falco.utils import simple_progress
|
|
7
|
+
from jinja2 import Template
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
IMPORT_START_COMMENT = "# IMPORTS:START"
|
|
11
|
+
IMPORT_END_COMMENT = "# IMPORTS:END"
|
|
12
|
+
CODE_START_COMMENT = "# CODE:START"
|
|
13
|
+
CODE_END_COMMENT = "# CODE:END"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def render_to_string(template_content: str, context: dict):
|
|
17
|
+
return Template(template_content).render(**context)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_crud_blueprints_path() -> Path:
|
|
21
|
+
package = importlib.util.find_spec("falco")
|
|
22
|
+
if package is None:
|
|
23
|
+
raise cappa.Exit("The falco base install path could not be found.", code=1)
|
|
24
|
+
return Path(package.submodule_search_locations[0]) / "crud"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@simple_progress("Running python formatters")
|
|
28
|
+
def run_python_formatters(filepath: str | Path):
|
|
29
|
+
autoflake = [
|
|
30
|
+
"autoflake",
|
|
31
|
+
"--in-place",
|
|
32
|
+
"--remove-all-unused-imports",
|
|
33
|
+
filepath,
|
|
34
|
+
]
|
|
35
|
+
black = ["black", filepath]
|
|
36
|
+
isort = ["isort", filepath]
|
|
37
|
+
subprocess.run(autoflake, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
38
|
+
subprocess.run(isort, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
39
|
+
subprocess.run(black, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@simple_progress("Running html formatters")
|
|
43
|
+
def run_html_formatters(filepath: str | Path):
|
|
44
|
+
djlint = ["djlint", filepath, "--reformat"]
|
|
45
|
+
subprocess.run(djlint, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def extract_python_file_templates(file_content: str) -> tuple[str, str]:
|
|
49
|
+
imports_template = extract_content_from(file_content, IMPORT_START_COMMENT, IMPORT_END_COMMENT)
|
|
50
|
+
code_template = extract_content_from(file_content, CODE_START_COMMENT, CODE_END_COMMENT)
|
|
51
|
+
return imports_template, code_template
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def extract_content_from(text: str, start_comment: str, end_comment: str):
|
|
55
|
+
start_index = text.find(start_comment) + len(start_comment)
|
|
56
|
+
end_index = text.find(end_comment)
|
|
57
|
+
return text[start_index:end_index]
|
|
@@ -4,7 +4,7 @@ from typing import Annotated
|
|
|
4
4
|
|
|
5
5
|
import cappa
|
|
6
6
|
import parso
|
|
7
|
-
from falco.commands.
|
|
7
|
+
from falco.commands.crud.utils import run_python_formatters
|
|
8
8
|
from falco.utils import get_project_name
|
|
9
9
|
from falco.utils import run_in_shell
|
|
10
10
|
from falco.utils import simple_progress
|
|
@@ -15,6 +15,7 @@ from cookiecutter.exceptions import CookiecutterException
|
|
|
15
15
|
from cruft import create
|
|
16
16
|
from cruft.exceptions import InvalidCookiecutterRepository
|
|
17
17
|
from falco.commands import InstallCrudUtils
|
|
18
|
+
from falco.commands.crud.utils import run_html_formatters
|
|
18
19
|
from falco.commands.htmx import Htmx
|
|
19
20
|
from falco.utils import clean_project_name
|
|
20
21
|
from falco.utils import is_new_falco_cli_available
|
|
@@ -120,6 +121,8 @@ class StartProject:
|
|
|
120
121
|
InstallCrudUtils()(project_name=self.project_name)
|
|
121
122
|
self.cruft_file_to_falco_config()
|
|
122
123
|
|
|
124
|
+
run_html_formatters(project_dir / self.project_name / "templates")
|
|
125
|
+
|
|
123
126
|
msg = f"{RICH_SUCCESS_MARKER} Project initialized, keep up the good work!\n"
|
|
124
127
|
msg += (
|
|
125
128
|
f"{RICH_INFO_MARKER} If you like the project consider dropping a star at "
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# IMPORTS:START
|
|
2
|
-
from {{
|
|
2
|
+
from {{crud_utils_import}}.utils import paginate_queryset
|
|
3
3
|
{% if login %}
|
|
4
|
-
from {{
|
|
4
|
+
from {{crud_utils_import}}.types import AuthenticatedHttpRequest
|
|
5
5
|
{% else %}
|
|
6
|
-
from {{
|
|
6
|
+
from {{crud_utils_import}}.types import HttpRequest
|
|
7
7
|
{% endif %}
|
|
8
8
|
|
|
9
9
|
from django.http import HttpRequest
|
|
@@ -34,6 +34,7 @@ def test_htmx_download_to_output_file(runner: CommandRunner):
|
|
|
34
34
|
|
|
35
35
|
def test_htmx_with_pyproject_toml(runner: CommandRunner):
|
|
36
36
|
pyproject_toml = Path("pyproject.toml")
|
|
37
|
+
pyproject_toml.touch()
|
|
37
38
|
write_falco_config(pyproject_path=pyproject_toml)
|
|
38
39
|
runner.invoke("htmx")
|
|
39
40
|
assert Path("htmx.min.js").exists()
|
|
@@ -43,6 +44,7 @@ def test_htmx_with_pyproject_toml(runner: CommandRunner):
|
|
|
43
44
|
|
|
44
45
|
def test_htmx_with_pyproject_toml_custom_folder(runner: CommandRunner):
|
|
45
46
|
pyproject_toml = Path("pyproject.toml")
|
|
47
|
+
pyproject_toml.touch()
|
|
46
48
|
write_falco_config(pyproject_path=pyproject_toml)
|
|
47
49
|
runner.invoke("htmx", "-o", "static/htmx")
|
|
48
50
|
output = Path("static/htmx/htmx.min.js")
|
|
@@ -53,6 +55,7 @@ def test_htmx_with_pyproject_toml_custom_folder(runner: CommandRunner):
|
|
|
53
55
|
|
|
54
56
|
def test_htmx_with_pyproject_toml_custom_file(runner: CommandRunner):
|
|
55
57
|
pyproject_toml = Path("pyproject.toml")
|
|
58
|
+
pyproject_toml.touch()
|
|
56
59
|
write_falco_config(pyproject_path=pyproject_toml)
|
|
57
60
|
runner.invoke("htmx", "-o", "static/htmx/htmx.js")
|
|
58
61
|
output = Path("static/htmx/htmx.js")
|
|
@@ -63,6 +66,7 @@ def test_htmx_with_pyproject_toml_custom_file(runner: CommandRunner):
|
|
|
63
66
|
|
|
64
67
|
def test_htmx_with_pyproject_toml_custom_file_existing_config(runner: CommandRunner):
|
|
65
68
|
pyproject_toml = Path("pyproject.toml")
|
|
69
|
+
pyproject_toml.touch()
|
|
66
70
|
write_falco_config(pyproject_path=pyproject_toml, htmx="config/htmx/htmx.js")
|
|
67
71
|
existing_path = Path("config/htmx/htmx.js")
|
|
68
72
|
runner.invoke("htmx")
|