piccolo 1.5.1__tar.gz → 1.5.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.
- {piccolo-1.5.1 → piccolo-1.5.2}/PKG-INFO +1 -1
- piccolo-1.5.2/piccolo/__init__.py +1 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/commands/run.py +70 -18
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/base.py +1 -5
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/PKG-INFO +1 -1
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_forwards_backwards.py +3 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/shell/commands/test_run.py +1 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/conf/test_apps.py +6 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/tables.py +10 -0
- piccolo-1.5.2/tests/table/test_output.py +160 -0
- piccolo-1.5.1/piccolo/__init__.py +0 -1
- piccolo-1.5.1/tests/table/test_output.py +0 -108
- {piccolo-1.5.1 → piccolo-1.5.2}/LICENSE +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/README.md +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/show_all.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/dump.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/load.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/shared.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/commands/version.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/migration_manager.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/operations.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/serialisation.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/backwards.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/check.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/clean.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/forwards.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/tables.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/commands/new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/exceptions.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/generate.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/graph.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/commands/run.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/commands/run.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/commands/run.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/change_password.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/change_permissions.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/create.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/list.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/tables.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/choices.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/column_types.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/combination.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/date.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/interval.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/time.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/timestamp.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/timestamptz.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/uuid.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/indexes.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/m2m.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/comparison.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/math.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/string.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/readable.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/reference.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/conf/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/conf/apps.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/custom_types.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/cockroach.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/exceptions.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/finder.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/postgres.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/sqlite.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/main.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/py.typed +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/alter.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/count.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/create.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/create_index.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/delete.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/drop_index.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/exists.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/indexes.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/insert.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/objects.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/raw.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/refresh.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/select.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/table_exists.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/update.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/mixins.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/proxy.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/querystring.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/schema.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/table.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/table_reflection.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/testing/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/testing/model_builder.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/testing/random_builder.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/dictionary.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/encoding.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/graphlib/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/graphlib/_graphlib.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/lazy_loader.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/list.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/naming.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/objects.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/printing.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/pydantic.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/repr.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/sql_values.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/sync.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/warnings.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/SOURCES.txt +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/dependency_links.txt +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/entry_points.txt +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/requires.txt +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/top_level.txt +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/profiling/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/profiling/run_profile.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/pyproject.toml +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/setup.cfg +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/setup.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/commands/test_new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/commands/test_show_all.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/asgi/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/asgi/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/asgi/commands/test_new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/commands/test_shared.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/meta/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/meta/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/meta/commands/test_version.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/integration/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/integration/test_migrations.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_migration_manager.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_serialisation.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_check.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_clean.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/test_migration.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/project/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/project/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/project/commands/test_new.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/schema/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/shell/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/shell/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/sql_shell/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/sql_shell/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/sql_shell/commands/test_run.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/tester/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_change_password.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_change_permissions.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_create.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_list.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/test_tables.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/test_m2m.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/test_m2m_schema.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_array.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_base.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_bigint.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_boolean.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_bytea.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_choices.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_combination.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_date.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_db_column_name.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_defaults.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_double_precision.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_interval.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_json.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_jsonb.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_numeric.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_primary_key.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_readable.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_real.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_reference.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_reserved_column_names.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_smallint.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_time.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_timestamp.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_timestamptz.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_uuid.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_varchar.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/conf/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/conf/example.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_extra_nodes.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_logging.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_nested_transaction.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_pool.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_transaction.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_version_parsing.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/tables.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/piccolo_app.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/tables_detailed.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/mixins/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/mixins/test_columns_delegate.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/mixins/test_order_by_delegate.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_await.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_camelcase.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_freeze.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_gather.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_querystring.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_slots.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_create.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_get_related.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_get_related_readable.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_instantiate.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_remove.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_save.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_to_dict.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_all_columns.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_alter.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_batch.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_callback.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_constructor.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_count.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_create.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_create_db_tables.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_create_table_class.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_delete.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_drop_db_tables.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_exists.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_from_dict.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_indexes.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_inheritance.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_insert.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_join.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_join_on.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_metaclass.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_objects.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_raw.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_ref.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_refresh.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_repr.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_select.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_str.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_table_exists.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_update.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/test_main.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/test_schema.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/testing/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/testing/test_model_builder.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/testing/test_random_builder.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/__init__.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_dictionary.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_encoding.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_lazy_loader.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_list.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_naming.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_printing.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_pydantic.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_sql_values.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_sync.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_table_reflection.py +0 -0
- {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_warnings.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__VERSION__ = "1.5.2"
|
@@ -5,7 +5,6 @@ for interacting with the data using Piccolo.
|
|
5
5
|
|
6
6
|
import datetime
|
7
7
|
import sys
|
8
|
-
import typing as t
|
9
8
|
import uuid
|
10
9
|
from decimal import Decimal
|
11
10
|
from enum import Enum
|
@@ -14,10 +13,12 @@ from piccolo.columns import (
|
|
14
13
|
JSON,
|
15
14
|
UUID,
|
16
15
|
Boolean,
|
16
|
+
Date,
|
17
17
|
ForeignKey,
|
18
18
|
Integer,
|
19
19
|
Interval,
|
20
20
|
Numeric,
|
21
|
+
Serial,
|
21
22
|
Timestamp,
|
22
23
|
Varchar,
|
23
24
|
)
|
@@ -29,6 +30,7 @@ from piccolo.utils.warnings import colored_string
|
|
29
30
|
|
30
31
|
|
31
32
|
class Manager(Table):
|
33
|
+
id: Serial
|
32
34
|
name = Varchar(length=50)
|
33
35
|
|
34
36
|
@classmethod
|
@@ -40,6 +42,7 @@ class Manager(Table):
|
|
40
42
|
|
41
43
|
|
42
44
|
class Band(Table):
|
45
|
+
id: Serial
|
43
46
|
name = Varchar(length=50)
|
44
47
|
manager = ForeignKey(references=Manager, null=True)
|
45
48
|
popularity = Integer()
|
@@ -53,6 +56,7 @@ class Band(Table):
|
|
53
56
|
|
54
57
|
|
55
58
|
class Venue(Table):
|
59
|
+
id: Serial
|
56
60
|
name = Varchar(length=100)
|
57
61
|
capacity = Integer(default=0)
|
58
62
|
|
@@ -65,6 +69,7 @@ class Venue(Table):
|
|
65
69
|
|
66
70
|
|
67
71
|
class Concert(Table):
|
72
|
+
id: Serial
|
68
73
|
band_1 = ForeignKey(Band)
|
69
74
|
band_2 = ForeignKey(Band)
|
70
75
|
venue = ForeignKey(Venue)
|
@@ -89,6 +94,7 @@ class Ticket(Table):
|
|
89
94
|
standing = "standing"
|
90
95
|
premium = "premium"
|
91
96
|
|
97
|
+
id: Serial
|
92
98
|
concert = ForeignKey(Concert)
|
93
99
|
price = Numeric(digits=(5, 2))
|
94
100
|
ticket_type = Varchar(choices=TicketType, default=TicketType.standing)
|
@@ -98,13 +104,14 @@ class Ticket(Table):
|
|
98
104
|
return Readable(
|
99
105
|
template="%s - %s",
|
100
106
|
columns=[
|
101
|
-
|
107
|
+
cls.concert._.venue._.name,
|
102
108
|
cls.ticket_type,
|
103
109
|
],
|
104
110
|
)
|
105
111
|
|
106
112
|
|
107
113
|
class DiscountCode(Table):
|
114
|
+
id: Serial
|
108
115
|
code = UUID()
|
109
116
|
active = Boolean(default=True, null=True)
|
110
117
|
|
@@ -117,6 +124,7 @@ class DiscountCode(Table):
|
|
117
124
|
|
118
125
|
|
119
126
|
class RecordingStudio(Table):
|
127
|
+
id: Serial
|
120
128
|
name = Varchar(length=100)
|
121
129
|
facilities = JSON(null=True)
|
122
130
|
|
@@ -128,7 +136,31 @@ class RecordingStudio(Table):
|
|
128
136
|
)
|
129
137
|
|
130
138
|
|
131
|
-
|
139
|
+
class Album(Table):
|
140
|
+
id: Serial
|
141
|
+
name = Varchar()
|
142
|
+
band = ForeignKey(Band)
|
143
|
+
release_date = Date()
|
144
|
+
recorded_at = ForeignKey(RecordingStudio)
|
145
|
+
|
146
|
+
@classmethod
|
147
|
+
def get_readable(cls) -> Readable:
|
148
|
+
return Readable(
|
149
|
+
template="%s - %s",
|
150
|
+
columns=[cls.name, cls.band._.name],
|
151
|
+
)
|
152
|
+
|
153
|
+
|
154
|
+
TABLES = (
|
155
|
+
Manager,
|
156
|
+
Band,
|
157
|
+
Venue,
|
158
|
+
Concert,
|
159
|
+
Ticket,
|
160
|
+
DiscountCode,
|
161
|
+
RecordingStudio,
|
162
|
+
Album,
|
163
|
+
)
|
132
164
|
|
133
165
|
|
134
166
|
def populate():
|
@@ -184,24 +216,44 @@ def populate():
|
|
184
216
|
*[DiscountCode({DiscountCode.code: uuid.uuid4()}) for _ in range(5)]
|
185
217
|
).run_sync()
|
186
218
|
|
187
|
-
RecordingStudio
|
188
|
-
|
219
|
+
recording_studio_1 = RecordingStudio(
|
220
|
+
{
|
221
|
+
RecordingStudio.name: "Abbey Road",
|
222
|
+
RecordingStudio.facilities: {
|
223
|
+
"restaurant": True,
|
224
|
+
"mixing_desk": True,
|
225
|
+
},
|
226
|
+
}
|
227
|
+
)
|
228
|
+
recording_studio_1.save().run_sync()
|
229
|
+
|
230
|
+
recording_studio_2 = RecordingStudio(
|
231
|
+
{
|
232
|
+
RecordingStudio.name: "Electric Lady",
|
233
|
+
RecordingStudio.facilities: {
|
234
|
+
"restaurant": False,
|
235
|
+
"mixing_desk": True,
|
236
|
+
},
|
237
|
+
},
|
238
|
+
)
|
239
|
+
recording_studio_2.save().run_sync()
|
240
|
+
|
241
|
+
Album.insert(
|
242
|
+
Album(
|
189
243
|
{
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
},
|
244
|
+
Album.name: "Awesome album 1",
|
245
|
+
Album.recorded_at: recording_studio_1,
|
246
|
+
Album.band: pythonistas,
|
247
|
+
Album.release_date: datetime.date(year=2021, month=1, day=1),
|
195
248
|
}
|
196
249
|
),
|
197
|
-
|
250
|
+
Album(
|
198
251
|
{
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
},
|
252
|
+
Album.name: "Awesome album 2",
|
253
|
+
Album.recorded_at: recording_studio_2,
|
254
|
+
Album.band: rustaceans,
|
255
|
+
Album.release_date: datetime.date(year=2022, month=2, day=2),
|
256
|
+
}
|
205
257
|
),
|
206
258
|
).run_sync()
|
207
259
|
|
@@ -278,7 +330,7 @@ def run(
|
|
278
330
|
|
279
331
|
populate()
|
280
332
|
|
281
|
-
from IPython.core.
|
333
|
+
from IPython.core.async_helpers import _asyncio_runner
|
282
334
|
|
283
335
|
if ipython_profile:
|
284
336
|
print(colored_string("Using your IPython profile\n"))
|
@@ -87,13 +87,9 @@ class Query(t.Generic[TableInstance, QueryResponseType]):
|
|
87
87
|
for column in json_columns:
|
88
88
|
if column._alias is not None:
|
89
89
|
json_column_names.append(column._alias)
|
90
|
-
elif column.json_operator is not None:
|
91
|
-
json_column_names.append(column._meta.name)
|
92
90
|
elif len(column._meta.call_chain) > 0:
|
93
91
|
json_column_names.append(
|
94
|
-
column.
|
95
|
-
engine_type=column._meta.engine_type
|
96
|
-
)
|
92
|
+
column._meta.get_default_alias().replace("$", ".")
|
97
93
|
)
|
98
94
|
else:
|
99
95
|
json_column_names.append(column._meta.name)
|
@@ -13,6 +13,7 @@ from tests.base import engines_only
|
|
13
13
|
from tests.example_apps.music.tables import (
|
14
14
|
Band,
|
15
15
|
Concert,
|
16
|
+
Instrument,
|
16
17
|
Manager,
|
17
18
|
Poster,
|
18
19
|
RecordingStudio,
|
@@ -33,6 +34,7 @@ TABLE_CLASSES: t.List[t.Type[Table]] = [
|
|
33
34
|
Poster,
|
34
35
|
Shirt,
|
35
36
|
RecordingStudio,
|
37
|
+
Instrument,
|
36
38
|
]
|
37
39
|
|
38
40
|
|
@@ -211,6 +213,7 @@ class TestForwardsBackwards(TestCase):
|
|
211
213
|
"2021-07-25T22:38:48:009306",
|
212
214
|
"2021-09-06T13:58:23:024723",
|
213
215
|
"2021-11-13T14:01:46:114725",
|
216
|
+
"2024-05-28T23:15:41:018844",
|
214
217
|
],
|
215
218
|
)
|
216
219
|
|
@@ -9,6 +9,7 @@ from tests.example_apps.mega.tables import MegaTable, SmallTable
|
|
9
9
|
from tests.example_apps.music.tables import (
|
10
10
|
Band,
|
11
11
|
Concert,
|
12
|
+
Instrument,
|
12
13
|
Manager,
|
13
14
|
Poster,
|
14
15
|
RecordingStudio,
|
@@ -113,6 +114,7 @@ class TestTableFinder(TestCase):
|
|
113
114
|
[
|
114
115
|
"Band",
|
115
116
|
"Concert",
|
117
|
+
"Instrument",
|
116
118
|
"Manager",
|
117
119
|
"Poster",
|
118
120
|
"RecordingStudio",
|
@@ -139,6 +141,7 @@ class TestTableFinder(TestCase):
|
|
139
141
|
[
|
140
142
|
"Band",
|
141
143
|
"Concert",
|
144
|
+
"Instrument",
|
142
145
|
"Manager",
|
143
146
|
"Poster",
|
144
147
|
"RecordingStudio",
|
@@ -182,6 +185,7 @@ class TestTableFinder(TestCase):
|
|
182
185
|
[
|
183
186
|
"Band",
|
184
187
|
"Concert",
|
188
|
+
"Instrument",
|
185
189
|
"Manager",
|
186
190
|
"RecordingStudio",
|
187
191
|
"Shirt",
|
@@ -228,6 +232,7 @@ class TestFinder(TestCase):
|
|
228
232
|
[
|
229
233
|
Band,
|
230
234
|
Concert,
|
235
|
+
Instrument,
|
231
236
|
Manager,
|
232
237
|
MegaTable,
|
233
238
|
Poster,
|
@@ -247,6 +252,7 @@ class TestFinder(TestCase):
|
|
247
252
|
[
|
248
253
|
Band,
|
249
254
|
Concert,
|
255
|
+
Instrument,
|
250
256
|
Manager,
|
251
257
|
Poster,
|
252
258
|
RecordingStudio,
|
@@ -115,3 +115,13 @@ class RecordingStudio(Table):
|
|
115
115
|
id: Serial
|
116
116
|
facilities = JSON()
|
117
117
|
facilities_b = JSONB()
|
118
|
+
|
119
|
+
|
120
|
+
class Instrument(Table):
|
121
|
+
"""
|
122
|
+
Used for testing foreign keys to a table with a JSON column.
|
123
|
+
"""
|
124
|
+
|
125
|
+
id: Serial
|
126
|
+
name = Varchar()
|
127
|
+
recording_studio = ForeignKey(RecordingStudio)
|
@@ -0,0 +1,160 @@
|
|
1
|
+
import json
|
2
|
+
from unittest import TestCase
|
3
|
+
|
4
|
+
from piccolo.table import create_db_tables_sync, drop_db_tables_sync
|
5
|
+
from tests.base import DBTestCase
|
6
|
+
from tests.example_apps.music.tables import Band, Instrument, RecordingStudio
|
7
|
+
|
8
|
+
|
9
|
+
class TestOutputList(DBTestCase):
|
10
|
+
def test_output_as_list(self):
|
11
|
+
self.insert_row()
|
12
|
+
|
13
|
+
response = Band.select(Band.name).output(as_list=True).run_sync()
|
14
|
+
self.assertEqual(response, ["Pythonistas"])
|
15
|
+
|
16
|
+
# Make sure that if no rows are found, an empty list is returned.
|
17
|
+
empty_response = (
|
18
|
+
Band.select(Band.name)
|
19
|
+
.where(Band.name == "ABC123")
|
20
|
+
.output(as_list=True)
|
21
|
+
.run_sync()
|
22
|
+
)
|
23
|
+
self.assertEqual(empty_response, [])
|
24
|
+
|
25
|
+
|
26
|
+
class TestOutputJSON(DBTestCase):
|
27
|
+
def test_output_as_json(self):
|
28
|
+
self.insert_row()
|
29
|
+
|
30
|
+
response = Band.select(Band.name).output(as_json=True).run_sync()
|
31
|
+
|
32
|
+
self.assertEqual(json.loads(response), [{"name": "Pythonistas"}])
|
33
|
+
|
34
|
+
|
35
|
+
class TestOutputLoadJSON(TestCase):
|
36
|
+
tables = [RecordingStudio, Instrument]
|
37
|
+
json = {"a": 123}
|
38
|
+
|
39
|
+
def setUp(self):
|
40
|
+
create_db_tables_sync(*self.tables)
|
41
|
+
|
42
|
+
recording_studio = RecordingStudio(
|
43
|
+
{
|
44
|
+
RecordingStudio.facilities: self.json,
|
45
|
+
RecordingStudio.facilities_b: self.json,
|
46
|
+
}
|
47
|
+
)
|
48
|
+
recording_studio.save().run_sync()
|
49
|
+
|
50
|
+
instrument = Instrument(
|
51
|
+
{
|
52
|
+
Instrument.recording_studio: recording_studio,
|
53
|
+
Instrument.name: "Piccolo",
|
54
|
+
}
|
55
|
+
)
|
56
|
+
instrument.save().run_sync()
|
57
|
+
|
58
|
+
def tearDown(self):
|
59
|
+
drop_db_tables_sync(*self.tables)
|
60
|
+
|
61
|
+
def test_select(self):
|
62
|
+
results = (
|
63
|
+
RecordingStudio.select(
|
64
|
+
RecordingStudio.facilities, RecordingStudio.facilities_b
|
65
|
+
)
|
66
|
+
.output(load_json=True)
|
67
|
+
.run_sync()
|
68
|
+
)
|
69
|
+
|
70
|
+
self.assertEqual(
|
71
|
+
results,
|
72
|
+
[
|
73
|
+
{
|
74
|
+
"facilities": self.json,
|
75
|
+
"facilities_b": self.json,
|
76
|
+
}
|
77
|
+
],
|
78
|
+
)
|
79
|
+
|
80
|
+
def test_join(self):
|
81
|
+
"""
|
82
|
+
Make sure it works correctly when the JSON column is on a joined table.
|
83
|
+
|
84
|
+
https://github.com/piccolo-orm/piccolo/issues/1001
|
85
|
+
|
86
|
+
"""
|
87
|
+
results = (
|
88
|
+
Instrument.select(
|
89
|
+
Instrument.name,
|
90
|
+
Instrument.recording_studio._.facilities,
|
91
|
+
)
|
92
|
+
.output(load_json=True)
|
93
|
+
.run_sync()
|
94
|
+
)
|
95
|
+
|
96
|
+
self.assertEqual(
|
97
|
+
results,
|
98
|
+
[
|
99
|
+
{
|
100
|
+
"name": "Piccolo",
|
101
|
+
"recording_studio.facilities": self.json,
|
102
|
+
}
|
103
|
+
],
|
104
|
+
)
|
105
|
+
|
106
|
+
def test_join_with_alias(self):
|
107
|
+
results = (
|
108
|
+
Instrument.select(
|
109
|
+
Instrument.name,
|
110
|
+
Instrument.recording_studio._.facilities.as_alias(
|
111
|
+
"facilities"
|
112
|
+
),
|
113
|
+
)
|
114
|
+
.output(load_json=True)
|
115
|
+
.run_sync()
|
116
|
+
)
|
117
|
+
|
118
|
+
self.assertEqual(
|
119
|
+
results,
|
120
|
+
[
|
121
|
+
{
|
122
|
+
"name": "Piccolo",
|
123
|
+
"facilities": self.json,
|
124
|
+
}
|
125
|
+
],
|
126
|
+
)
|
127
|
+
|
128
|
+
def test_objects(self):
|
129
|
+
results = RecordingStudio.objects().output(load_json=True).run_sync()
|
130
|
+
self.assertEqual(results[0].facilities, self.json)
|
131
|
+
self.assertEqual(results[0].facilities_b, self.json)
|
132
|
+
|
133
|
+
|
134
|
+
class TestOutputNested(DBTestCase):
|
135
|
+
def test_output_nested(self):
|
136
|
+
self.insert_row()
|
137
|
+
|
138
|
+
response = (
|
139
|
+
Band.select(Band.name, Band.manager.name)
|
140
|
+
.output(nested=True)
|
141
|
+
.run_sync()
|
142
|
+
)
|
143
|
+
self.assertEqual(
|
144
|
+
response, [{"name": "Pythonistas", "manager": {"name": "Guido"}}]
|
145
|
+
)
|
146
|
+
|
147
|
+
def test_output_nested_with_first(self):
|
148
|
+
self.insert_row()
|
149
|
+
|
150
|
+
response = (
|
151
|
+
Band.select(Band.name, Band.manager.name)
|
152
|
+
.first()
|
153
|
+
.output(nested=True)
|
154
|
+
.run_sync()
|
155
|
+
)
|
156
|
+
assert response is not None
|
157
|
+
self.assertDictEqual(
|
158
|
+
response, # type: ignore
|
159
|
+
{"name": "Pythonistas", "manager": {"name": "Guido"}},
|
160
|
+
)
|
@@ -1 +0,0 @@
|
|
1
|
-
__VERSION__ = "1.5.1"
|
@@ -1,108 +0,0 @@
|
|
1
|
-
import json
|
2
|
-
from unittest import TestCase
|
3
|
-
|
4
|
-
from tests.base import DBTestCase, engine_is
|
5
|
-
from tests.example_apps.music.tables import Band, RecordingStudio
|
6
|
-
|
7
|
-
|
8
|
-
class TestOutputList(DBTestCase):
|
9
|
-
def test_output_as_list(self):
|
10
|
-
self.insert_row()
|
11
|
-
|
12
|
-
response = Band.select(Band.name).output(as_list=True).run_sync()
|
13
|
-
self.assertEqual(response, ["Pythonistas"])
|
14
|
-
|
15
|
-
# Make sure that if no rows are found, an empty list is returned.
|
16
|
-
empty_response = (
|
17
|
-
Band.select(Band.name)
|
18
|
-
.where(Band.name == "ABC123")
|
19
|
-
.output(as_list=True)
|
20
|
-
.run_sync()
|
21
|
-
)
|
22
|
-
self.assertEqual(empty_response, [])
|
23
|
-
|
24
|
-
|
25
|
-
class TestOutputJSON(DBTestCase):
|
26
|
-
def test_output_as_json(self):
|
27
|
-
self.insert_row()
|
28
|
-
|
29
|
-
response = Band.select(Band.name).output(as_json=True).run_sync()
|
30
|
-
|
31
|
-
self.assertEqual(json.loads(response), [{"name": "Pythonistas"}])
|
32
|
-
|
33
|
-
|
34
|
-
class TestOutputLoadJSON(TestCase):
|
35
|
-
def setUp(self):
|
36
|
-
RecordingStudio.create_table().run_sync()
|
37
|
-
|
38
|
-
def tearDown(self):
|
39
|
-
RecordingStudio.alter().drop_table().run_sync()
|
40
|
-
|
41
|
-
def test_select(self):
|
42
|
-
json = {"a": 123}
|
43
|
-
|
44
|
-
RecordingStudio(facilities=json, facilities_b=json).save().run_sync()
|
45
|
-
|
46
|
-
results = RecordingStudio.select().output(load_json=True).run_sync()
|
47
|
-
|
48
|
-
if engine_is("cockroach"):
|
49
|
-
self.assertEqual(
|
50
|
-
results,
|
51
|
-
[
|
52
|
-
{
|
53
|
-
"id": results[0]["id"],
|
54
|
-
"facilities": {"a": 123},
|
55
|
-
"facilities_b": {"a": 123},
|
56
|
-
}
|
57
|
-
],
|
58
|
-
)
|
59
|
-
else:
|
60
|
-
self.assertEqual(
|
61
|
-
results,
|
62
|
-
[
|
63
|
-
{
|
64
|
-
"id": 1,
|
65
|
-
"facilities": {"a": 123},
|
66
|
-
"facilities_b": {"a": 123},
|
67
|
-
}
|
68
|
-
],
|
69
|
-
)
|
70
|
-
|
71
|
-
def test_objects(self):
|
72
|
-
json = {"a": 123}
|
73
|
-
|
74
|
-
RecordingStudio(facilities=json, facilities_b=json).save().run_sync()
|
75
|
-
|
76
|
-
results = RecordingStudio.objects().output(load_json=True).run_sync()
|
77
|
-
|
78
|
-
self.assertEqual(results[0].facilities, json)
|
79
|
-
self.assertEqual(results[0].facilities_b, json)
|
80
|
-
|
81
|
-
|
82
|
-
class TestOutputNested(DBTestCase):
|
83
|
-
def test_output_nested(self):
|
84
|
-
self.insert_row()
|
85
|
-
|
86
|
-
response = (
|
87
|
-
Band.select(Band.name, Band.manager.name)
|
88
|
-
.output(nested=True)
|
89
|
-
.run_sync()
|
90
|
-
)
|
91
|
-
self.assertEqual(
|
92
|
-
response, [{"name": "Pythonistas", "manager": {"name": "Guido"}}]
|
93
|
-
)
|
94
|
-
|
95
|
-
def test_output_nested_with_first(self):
|
96
|
-
self.insert_row()
|
97
|
-
|
98
|
-
response = (
|
99
|
-
Band.select(Band.name, Band.manager.name)
|
100
|
-
.first()
|
101
|
-
.output(nested=True)
|
102
|
-
.run_sync()
|
103
|
-
)
|
104
|
-
assert response is not None
|
105
|
-
self.assertDictEqual(
|
106
|
-
response, # type: ignore
|
107
|
-
{"name": "Pythonistas", "manager": {"name": "Guido"}},
|
108
|
-
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja
RENAMED
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja
RENAMED
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja
RENAMED
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja
RENAMED
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja
RENAMED
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja
RENAMED
File without changes
|
File without changes
|
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja
RENAMED
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja
RENAMED
File without changes
|
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja
RENAMED
File without changes
|
{piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja
RENAMED
File without changes
|