piccolo 1.5.0__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.
Files changed (368) hide show
  1. {piccolo-1.5.0 → piccolo-1.5.2}/PKG-INFO +2 -2
  2. {piccolo-1.5.0 → piccolo-1.5.2}/README.md +1 -1
  3. piccolo-1.5.2/piccolo/__init__.py +1 -0
  4. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/new.py +1 -0
  5. piccolo-1.5.2/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +45 -0
  6. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +2 -0
  7. piccolo-1.5.2/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +21 -0
  8. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +2 -0
  9. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +5 -0
  10. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/backwards.py +6 -4
  11. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/playground/commands/run.py +70 -18
  12. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/base.py +1 -5
  13. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo.egg-info/PKG-INFO +2 -2
  14. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo.egg-info/SOURCES.txt +2 -0
  15. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/test_forwards_backwards.py +3 -0
  16. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/shell/commands/test_run.py +1 -0
  17. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_array.py +0 -1
  18. {piccolo-1.5.0 → piccolo-1.5.2}/tests/conf/test_apps.py +6 -0
  19. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/music/tables.py +10 -0
  20. piccolo-1.5.2/tests/table/test_output.py +160 -0
  21. piccolo-1.5.0/piccolo/__init__.py +0 -1
  22. piccolo-1.5.0/tests/table/test_output.py +0 -108
  23. {piccolo-1.5.0 → piccolo-1.5.2}/LICENSE +0 -0
  24. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/__init__.py +0 -0
  25. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/app/__init__.py +0 -0
  26. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/app/commands/__init__.py +0 -0
  27. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/app/commands/new.py +0 -0
  28. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/app/commands/show_all.py +0 -0
  29. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
  30. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
  31. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/app/piccolo_app.py +0 -0
  32. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/__init__.py +0 -0
  33. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/__init__.py +0 -0
  34. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
  35. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +0 -0
  36. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +0 -0
  37. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
  38. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +0 -0
  39. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
  40. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
  41. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
  42. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
  43. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
  44. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
  45. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
  46. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
  47. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
  48. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
  49. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
  50. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
  51. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
  52. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
  53. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
  54. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
  55. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
  56. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/asgi/piccolo_app.py +0 -0
  57. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/fixtures/__init__.py +0 -0
  58. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/__init__.py +0 -0
  59. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/dump.py +0 -0
  60. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/load.py +0 -0
  61. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/shared.py +0 -0
  62. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/fixtures/piccolo_app.py +0 -0
  63. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/meta/__init__.py +0 -0
  64. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/meta/commands/__init__.py +0 -0
  65. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/meta/commands/version.py +0 -0
  66. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/meta/piccolo_app.py +0 -0
  67. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/__init__.py +0 -0
  68. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/__init__.py +0 -0
  69. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
  70. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/migration_manager.py +0 -0
  71. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/operations.py +0 -0
  72. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
  73. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
  74. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/serialisation.py +0 -0
  75. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
  76. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/__init__.py +0 -0
  77. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/base.py +0 -0
  78. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/check.py +0 -0
  79. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/clean.py +0 -0
  80. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/forwards.py +0 -0
  81. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/new.py +0 -0
  82. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
  83. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/piccolo_app.py +0 -0
  84. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/migrations/tables.py +0 -0
  85. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/playground/__init__.py +0 -0
  86. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/playground/commands/__init__.py +0 -0
  87. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/playground/piccolo_app.py +0 -0
  88. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/project/__init__.py +0 -0
  89. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/project/commands/__init__.py +0 -0
  90. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/project/commands/new.py +0 -0
  91. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
  92. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/project/piccolo_app.py +0 -0
  93. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/schema/__init__.py +0 -0
  94. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/schema/commands/__init__.py +0 -0
  95. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/schema/commands/exceptions.py +0 -0
  96. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/schema/commands/generate.py +0 -0
  97. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/schema/commands/graph.py +0 -0
  98. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
  99. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/schema/piccolo_app.py +0 -0
  100. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/shell/__init__.py +0 -0
  101. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/shell/commands/__init__.py +0 -0
  102. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/shell/commands/run.py +0 -0
  103. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/shell/piccolo_app.py +0 -0
  104. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/sql_shell/__init__.py +0 -0
  105. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
  106. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/sql_shell/commands/run.py +0 -0
  107. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
  108. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/tester/__init__.py +0 -0
  109. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/tester/commands/__init__.py +0 -0
  110. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/tester/commands/run.py +0 -0
  111. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/tester/piccolo_app.py +0 -0
  112. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/__init__.py +0 -0
  113. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/commands/__init__.py +0 -0
  114. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/commands/change_password.py +0 -0
  115. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/commands/change_permissions.py +0 -0
  116. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/commands/create.py +0 -0
  117. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/commands/list.py +0 -0
  118. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/piccolo_app.py +0 -0
  119. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
  120. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
  121. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
  122. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
  123. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/apps/user/tables.py +0 -0
  124. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/__init__.py +0 -0
  125. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/base.py +0 -0
  126. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/choices.py +0 -0
  127. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/column_types.py +0 -0
  128. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/combination.py +0 -0
  129. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/__init__.py +0 -0
  130. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/base.py +0 -0
  131. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/date.py +0 -0
  132. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/interval.py +0 -0
  133. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/time.py +0 -0
  134. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/timestamp.py +0 -0
  135. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/timestamptz.py +0 -0
  136. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/defaults/uuid.py +0 -0
  137. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/indexes.py +0 -0
  138. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/m2m.py +0 -0
  139. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/operators/__init__.py +0 -0
  140. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/operators/base.py +0 -0
  141. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/operators/comparison.py +0 -0
  142. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/operators/math.py +0 -0
  143. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/operators/string.py +0 -0
  144. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/readable.py +0 -0
  145. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/columns/reference.py +0 -0
  146. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/conf/__init__.py +0 -0
  147. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/conf/apps.py +0 -0
  148. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/custom_types.py +0 -0
  149. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/engine/__init__.py +0 -0
  150. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/engine/base.py +0 -0
  151. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/engine/cockroach.py +0 -0
  152. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/engine/exceptions.py +0 -0
  153. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/engine/finder.py +0 -0
  154. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/engine/postgres.py +0 -0
  155. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/engine/sqlite.py +0 -0
  156. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/main.py +0 -0
  157. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/py.typed +0 -0
  158. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/__init__.py +0 -0
  159. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/__init__.py +0 -0
  160. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/alter.py +0 -0
  161. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/count.py +0 -0
  162. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/create.py +0 -0
  163. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/create_index.py +0 -0
  164. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/delete.py +0 -0
  165. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/drop_index.py +0 -0
  166. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/exists.py +0 -0
  167. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/indexes.py +0 -0
  168. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/insert.py +0 -0
  169. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/objects.py +0 -0
  170. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/raw.py +0 -0
  171. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/refresh.py +0 -0
  172. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/select.py +0 -0
  173. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/table_exists.py +0 -0
  174. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/methods/update.py +0 -0
  175. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/mixins.py +0 -0
  176. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/query/proxy.py +0 -0
  177. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/querystring.py +0 -0
  178. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/schema.py +0 -0
  179. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/table.py +0 -0
  180. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/table_reflection.py +0 -0
  181. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/testing/__init__.py +0 -0
  182. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/testing/model_builder.py +0 -0
  183. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/testing/random_builder.py +0 -0
  184. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/__init__.py +0 -0
  185. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/dictionary.py +0 -0
  186. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/encoding.py +0 -0
  187. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/graphlib/__init__.py +0 -0
  188. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/graphlib/_graphlib.py +0 -0
  189. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/lazy_loader.py +0 -0
  190. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/list.py +0 -0
  191. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/naming.py +0 -0
  192. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/objects.py +0 -0
  193. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/printing.py +0 -0
  194. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/pydantic.py +0 -0
  195. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/repr.py +0 -0
  196. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/sql_values.py +0 -0
  197. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/sync.py +0 -0
  198. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo/utils/warnings.py +0 -0
  199. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo.egg-info/dependency_links.txt +0 -0
  200. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo.egg-info/entry_points.txt +0 -0
  201. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo.egg-info/requires.txt +0 -0
  202. {piccolo-1.5.0 → piccolo-1.5.2}/piccolo.egg-info/top_level.txt +0 -0
  203. {piccolo-1.5.0 → piccolo-1.5.2}/profiling/__init__.py +0 -0
  204. {piccolo-1.5.0 → piccolo-1.5.2}/profiling/run_profile.py +0 -0
  205. {piccolo-1.5.0 → piccolo-1.5.2}/pyproject.toml +0 -0
  206. {piccolo-1.5.0 → piccolo-1.5.2}/setup.cfg +0 -0
  207. {piccolo-1.5.0 → piccolo-1.5.2}/setup.py +0 -0
  208. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/__init__.py +0 -0
  209. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/app/__init__.py +0 -0
  210. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/app/commands/__init__.py +0 -0
  211. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/app/commands/test_new.py +0 -0
  212. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/app/commands/test_show_all.py +0 -0
  213. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/asgi/__init__.py +0 -0
  214. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/asgi/commands/__init__.py +0 -0
  215. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/asgi/commands/test_new.py +0 -0
  216. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/fixtures/__init__.py +0 -0
  217. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/fixtures/commands/__init__.py +0 -0
  218. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
  219. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/fixtures/commands/test_shared.py +0 -0
  220. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/meta/__init__.py +0 -0
  221. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/meta/commands/__init__.py +0 -0
  222. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/meta/commands/test_version.py +0 -0
  223. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/__init__.py +0 -0
  224. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/__init__.py +0 -0
  225. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/integration/__init__.py +0 -0
  226. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/integration/test_migrations.py +0 -0
  227. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
  228. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/test_migration_manager.py +0 -0
  229. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
  230. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
  231. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/auto/test_serialisation.py +0 -0
  232. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/__init__.py +0 -0
  233. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/test_base.py +0 -0
  234. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/test_check.py +0 -0
  235. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/test_clean.py +0 -0
  236. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
  237. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
  238. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/commands/test_new.py +0 -0
  239. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/migrations/test_migration.py +0 -0
  240. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/project/__init__.py +0 -0
  241. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/project/commands/__init__.py +0 -0
  242. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/project/commands/test_new.py +0 -0
  243. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/schema/__init__.py +0 -0
  244. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/shell/__init__.py +0 -0
  245. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/shell/commands/__init__.py +0 -0
  246. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/sql_shell/__init__.py +0 -0
  247. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/sql_shell/commands/__init__.py +0 -0
  248. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/sql_shell/commands/test_run.py +0 -0
  249. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/tester/__init__.py +0 -0
  250. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/user/__init__.py +0 -0
  251. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/user/commands/__init__.py +0 -0
  252. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/user/commands/test_change_password.py +0 -0
  253. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/user/commands/test_change_permissions.py +0 -0
  254. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/user/commands/test_create.py +0 -0
  255. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/user/commands/test_list.py +0 -0
  256. {piccolo-1.5.0 → piccolo-1.5.2}/tests/apps/user/test_tables.py +0 -0
  257. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/__init__.py +0 -0
  258. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/m2m/__init__.py +0 -0
  259. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/m2m/base.py +0 -0
  260. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/m2m/test_m2m.py +0 -0
  261. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/m2m/test_m2m_schema.py +0 -0
  262. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_base.py +0 -0
  263. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_bigint.py +0 -0
  264. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_boolean.py +0 -0
  265. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_bytea.py +0 -0
  266. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_choices.py +0 -0
  267. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_combination.py +0 -0
  268. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_date.py +0 -0
  269. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_db_column_name.py +0 -0
  270. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_defaults.py +0 -0
  271. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_double_precision.py +0 -0
  272. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_interval.py +0 -0
  273. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_json.py +0 -0
  274. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_jsonb.py +0 -0
  275. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_numeric.py +0 -0
  276. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_primary_key.py +0 -0
  277. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_readable.py +0 -0
  278. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_real.py +0 -0
  279. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_reference.py +0 -0
  280. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_reserved_column_names.py +0 -0
  281. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_smallint.py +0 -0
  282. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_time.py +0 -0
  283. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_timestamp.py +0 -0
  284. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_timestamptz.py +0 -0
  285. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_uuid.py +0 -0
  286. {piccolo-1.5.0 → piccolo-1.5.2}/tests/columns/test_varchar.py +0 -0
  287. {piccolo-1.5.0 → piccolo-1.5.2}/tests/conf/__init__.py +0 -0
  288. {piccolo-1.5.0 → piccolo-1.5.2}/tests/conf/example.py +0 -0
  289. {piccolo-1.5.0 → piccolo-1.5.2}/tests/engine/__init__.py +0 -0
  290. {piccolo-1.5.0 → piccolo-1.5.2}/tests/engine/test_extra_nodes.py +0 -0
  291. {piccolo-1.5.0 → piccolo-1.5.2}/tests/engine/test_logging.py +0 -0
  292. {piccolo-1.5.0 → piccolo-1.5.2}/tests/engine/test_nested_transaction.py +0 -0
  293. {piccolo-1.5.0 → piccolo-1.5.2}/tests/engine/test_pool.py +0 -0
  294. {piccolo-1.5.0 → piccolo-1.5.2}/tests/engine/test_transaction.py +0 -0
  295. {piccolo-1.5.0 → piccolo-1.5.2}/tests/engine/test_version_parsing.py +0 -0
  296. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/__init__.py +0 -0
  297. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/mega/__init__.py +0 -0
  298. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_app.py +0 -0
  299. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
  300. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
  301. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/mega/tables.py +0 -0
  302. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/music/__init__.py +0 -0
  303. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/music/piccolo_app.py +0 -0
  304. {piccolo-1.5.0 → piccolo-1.5.2}/tests/example_apps/music/tables_detailed.py +0 -0
  305. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/__init__.py +0 -0
  306. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/mixins/__init__.py +0 -0
  307. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/mixins/test_columns_delegate.py +0 -0
  308. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/mixins/test_order_by_delegate.py +0 -0
  309. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/test_await.py +0 -0
  310. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/test_camelcase.py +0 -0
  311. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/test_freeze.py +0 -0
  312. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/test_gather.py +0 -0
  313. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/test_querystring.py +0 -0
  314. {piccolo-1.5.0 → piccolo-1.5.2}/tests/query/test_slots.py +0 -0
  315. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/__init__.py +0 -0
  316. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/__init__.py +0 -0
  317. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/test_create.py +0 -0
  318. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/test_get_related.py +0 -0
  319. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/test_get_related_readable.py +0 -0
  320. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/test_instantiate.py +0 -0
  321. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/test_remove.py +0 -0
  322. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/test_save.py +0 -0
  323. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/instance/test_to_dict.py +0 -0
  324. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_all_columns.py +0 -0
  325. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_alter.py +0 -0
  326. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_batch.py +0 -0
  327. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_callback.py +0 -0
  328. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_constructor.py +0 -0
  329. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_count.py +0 -0
  330. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_create.py +0 -0
  331. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_create_db_tables.py +0 -0
  332. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_create_table_class.py +0 -0
  333. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_delete.py +0 -0
  334. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_drop_db_tables.py +0 -0
  335. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_exists.py +0 -0
  336. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_from_dict.py +0 -0
  337. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_indexes.py +0 -0
  338. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_inheritance.py +0 -0
  339. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_insert.py +0 -0
  340. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_join.py +0 -0
  341. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_join_on.py +0 -0
  342. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_metaclass.py +0 -0
  343. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_objects.py +0 -0
  344. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_raw.py +0 -0
  345. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_ref.py +0 -0
  346. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_refresh.py +0 -0
  347. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_repr.py +0 -0
  348. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_select.py +0 -0
  349. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_str.py +0 -0
  350. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_table_exists.py +0 -0
  351. {piccolo-1.5.0 → piccolo-1.5.2}/tests/table/test_update.py +0 -0
  352. {piccolo-1.5.0 → piccolo-1.5.2}/tests/test_main.py +0 -0
  353. {piccolo-1.5.0 → piccolo-1.5.2}/tests/test_schema.py +0 -0
  354. {piccolo-1.5.0 → piccolo-1.5.2}/tests/testing/__init__.py +0 -0
  355. {piccolo-1.5.0 → piccolo-1.5.2}/tests/testing/test_model_builder.py +0 -0
  356. {piccolo-1.5.0 → piccolo-1.5.2}/tests/testing/test_random_builder.py +0 -0
  357. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/__init__.py +0 -0
  358. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_dictionary.py +0 -0
  359. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_encoding.py +0 -0
  360. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_lazy_loader.py +0 -0
  361. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_list.py +0 -0
  362. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_naming.py +0 -0
  363. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_printing.py +0 -0
  364. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_pydantic.py +0 -0
  365. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_sql_values.py +0 -0
  366. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_sync.py +0 -0
  367. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_table_reflection.py +0 -0
  368. {piccolo-1.5.0 → piccolo-1.5.2}/tests/utils/test_warnings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: A fast, user friendly ORM and query builder which supports asyncio.
5
5
  Home-page: https://github.com/piccolo-orm/piccolo
6
6
  Author: Daniel Townsend
@@ -144,7 +144,7 @@ Let Piccolo scaffold you an ASGI web app, using Piccolo as the ORM:
144
144
  piccolo asgi new
145
145
  ```
146
146
 
147
- [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/) and [Esmerald](https://esmerald.dev/) are currently supported.
147
+ [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/), [Esmerald](https://esmerald.dev/) and [Lilya](https://lilya.dev) are currently supported.
148
148
 
149
149
  ## Are you a Django user?
150
150
 
@@ -94,7 +94,7 @@ Let Piccolo scaffold you an ASGI web app, using Piccolo as the ORM:
94
94
  piccolo asgi new
95
95
  ```
96
96
 
97
- [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/) and [Esmerald](https://esmerald.dev/) are currently supported.
97
+ [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/), [Esmerald](https://esmerald.dev/) and [Lilya](https://lilya.dev) are currently supported.
98
98
 
99
99
  ## Are you a Django user?
100
100
 
@@ -0,0 +1 @@
1
+ __VERSION__ = "1.5.2"
@@ -16,6 +16,7 @@ ROUTER_DEPENDENCIES = {
16
16
  "blacksheep": ["blacksheep"],
17
17
  "litestar": ["litestar"],
18
18
  "esmerald": ["esmerald"],
19
+ "lilya": ["lilya"],
19
20
  }
20
21
  ROUTERS = list(ROUTER_DEPENDENCIES.keys())
21
22
 
@@ -0,0 +1,45 @@
1
+ from piccolo_admin.endpoints import create_admin
2
+ from piccolo_api.crud.endpoints import PiccoloCRUD
3
+ from piccolo.engine import engine_finder
4
+ from lilya.routing import Path, Include
5
+ from lilya.apps import Lilya
6
+ from lilya.staticfiles import StaticFiles
7
+
8
+ from home.endpoints import HomeController
9
+ from home.piccolo_app import APP_CONFIG
10
+ from home.tables import Task
11
+
12
+
13
+ app = Lilya(
14
+ routes=[
15
+ Path("/", HomeController),
16
+ Include(
17
+ "/admin/",
18
+ create_admin(
19
+ tables=APP_CONFIG.table_classes,
20
+ # Required when running under HTTPS:
21
+ # allowed_hosts=['my_site.com']
22
+ )
23
+ ),
24
+ Include("/static/", StaticFiles(directory="static")),
25
+ Include("/tasks/", PiccoloCRUD(table=Task))
26
+ ],
27
+ )
28
+
29
+
30
+ @app.on_event("on_startup")
31
+ async def open_database_connection_pool():
32
+ try:
33
+ engine = engine_finder()
34
+ await engine.start_connection_pool()
35
+ except Exception:
36
+ print("Unable to connect to the database")
37
+
38
+
39
+ @app.on_event("on_shutdown")
40
+ async def close_database_connection_pool():
41
+ try:
42
+ engine = engine_finder()
43
+ await engine.close_connection_pool()
44
+ except Exception:
45
+ print("Unable to connect to the database")
@@ -8,4 +8,6 @@
8
8
  {% include '_litestar_app.py.jinja' %}
9
9
  {% elif router == 'esmerald' %}
10
10
  {% include '_esmerald_app.py.jinja' %}
11
+ {% elif router == 'lilya' %}
12
+ {% include '_lilya_app.py.jinja' %}
11
13
  {% endif %}
@@ -0,0 +1,21 @@
1
+ import os
2
+
3
+ import jinja2
4
+ from lilya.controllers import Controller
5
+ from lilya.responses import HTMLResponse
6
+
7
+
8
+ ENVIRONMENT = jinja2.Environment(
9
+ loader=jinja2.FileSystemLoader(
10
+ searchpath=os.path.join(os.path.dirname(__file__), "templates")
11
+ )
12
+ )
13
+
14
+
15
+ class HomeController(Controller):
16
+ async def get(self, request):
17
+ template = ENVIRONMENT.get_template("home.html.jinja")
18
+
19
+ content = template.render(title="Piccolo + ASGI",)
20
+
21
+ return HTMLResponse(content)
@@ -6,4 +6,6 @@
6
6
  {% include '_litestar_endpoints.py.jinja' %}
7
7
  {% elif router == 'esmerald' %}
8
8
  {% include '_esmerald_endpoints.py.jinja' %}
9
+ {% elif router == 'lilya' %}
10
+ {% include '_lilya_endpoints.py.jinja' %}
9
11
  {% endif %}
@@ -61,6 +61,11 @@
61
61
  <li><a href="/admin/">Admin</a></li>
62
62
  <li><a href="/docs/swagger">Swagger API</a></li>
63
63
  </ul>
64
+ <h3>Lilya</h3>
65
+ <ul>
66
+ <li><a href="/admin/">Admin</a></li>
67
+ <li><a href="/tasks/">JSON endpoint</a></li>
68
+ </ul>
64
69
  </section>
65
70
  </div>
66
71
  {% endblock content %}
@@ -78,9 +78,11 @@ class BackwardsMigrationManager(BaseMigrationManager):
78
78
  _continue = (
79
79
  "y"
80
80
  if self.auto_agree
81
- else input(f"Reverse {n} migration{'s' if n != 1 else ''}? [y/N] ")
81
+ else input(
82
+ f"Reverse {n} migration{'s' if n != 1 else ''}? [y/N] "
83
+ ).lower()
82
84
  )
83
- if _continue in "yY":
85
+ if _continue == "y":
84
86
  for migration_id in reversed_migration_ids:
85
87
  migration_module = migration_modules[migration_id]
86
88
  response = await migration_module.forwards()
@@ -131,10 +133,10 @@ async def run_backwards(
131
133
  "apps:\n"
132
134
  f"{', '.join(names)}\n"
133
135
  "Are you sure you want to continue? [y/N] "
134
- )
136
+ ).lower()
135
137
  )
136
138
 
137
- if _continue not in "yY":
139
+ if _continue != "y":
138
140
  return MigrationResult(success=False, message="user cancelled")
139
141
  for _app_name in sorted_app_names:
140
142
  print_heading(_app_name)
@@ -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
- t.cast(t.Type[Venue], cls.concert.venue).name,
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
- TABLES = (Manager, Band, Venue, Concert, Ticket, DiscountCode, RecordingStudio)
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.insert(
188
- RecordingStudio(
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
- RecordingStudio.name: "Abbey Road",
191
- RecordingStudio.facilities: {
192
- "restaurant": True,
193
- "mixing_desk": True,
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
- RecordingStudio(
250
+ Album(
198
251
  {
199
- RecordingStudio.name: "Electric Lady",
200
- RecordingStudio.facilities: {
201
- "restaurant": False,
202
- "mixing_desk": True,
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.interactiveshell import _asyncio_runner
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.get_select_string(
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: A fast, user friendly ORM and query builder which supports asyncio.
5
5
  Home-page: https://github.com/piccolo-orm/piccolo
6
6
  Author: Daniel Townsend
@@ -144,7 +144,7 @@ Let Piccolo scaffold you an ASGI web app, using Piccolo as the ORM:
144
144
  piccolo asgi new
145
145
  ```
146
146
 
147
- [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/) and [Esmerald](https://esmerald.dev/) are currently supported.
147
+ [Starlette](https://www.starlette.io/), [FastAPI](https://fastapi.tiangolo.com/), [BlackSheep](https://www.neoteroi.dev/blacksheep/), [Litestar](https://litestar.dev/), [Esmerald](https://esmerald.dev/) and [Lilya](https://lilya.dev) are currently supported.
148
148
 
149
149
  ## Are you a Django user?
150
150
 
@@ -32,6 +32,7 @@ piccolo/apps/asgi/commands/templates/app/README.md.jinja
32
32
  piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja
33
33
  piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja
34
34
  piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja
35
+ piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja
35
36
  piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja
36
37
  piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja
37
38
  piccolo/apps/asgi/commands/templates/app/app.py.jinja
@@ -43,6 +44,7 @@ piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja
43
44
  piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja
44
45
  piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja
45
46
  piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja
47
+ piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja
46
48
  piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja
47
49
  piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja
48
50
  piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja
@@ -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
 
@@ -20,6 +20,7 @@ class TestRun(TestCase):
20
20
  call("Importing music tables:"),
21
21
  call("- Band"),
22
22
  call("- Concert"),
23
+ call("- Instrument"),
23
24
  call("- Manager"),
24
25
  call("- Poster"),
25
26
  call("- RecordingStudio"),
@@ -213,7 +213,6 @@ class TestGetDimensions(TestCase):
213
213
 
214
214
 
215
215
  class TestGetInnerValueType(TestCase):
216
-
217
216
  def test_get_inner_value_type(self):
218
217
  """
219
218
  Make sure that `_get_inner_value_type` returns the correct base type.
@@ -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.0"