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.
Files changed (368) hide show
  1. {piccolo-1.5.1 → piccolo-1.5.2}/PKG-INFO +1 -1
  2. piccolo-1.5.2/piccolo/__init__.py +1 -0
  3. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/commands/run.py +70 -18
  4. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/base.py +1 -5
  5. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/PKG-INFO +1 -1
  6. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_forwards_backwards.py +3 -0
  7. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/shell/commands/test_run.py +1 -0
  8. {piccolo-1.5.1 → piccolo-1.5.2}/tests/conf/test_apps.py +6 -0
  9. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/tables.py +10 -0
  10. piccolo-1.5.2/tests/table/test_output.py +160 -0
  11. piccolo-1.5.1/piccolo/__init__.py +0 -1
  12. piccolo-1.5.1/tests/table/test_output.py +0 -108
  13. {piccolo-1.5.1 → piccolo-1.5.2}/LICENSE +0 -0
  14. {piccolo-1.5.1 → piccolo-1.5.2}/README.md +0 -0
  15. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/__init__.py +0 -0
  16. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/__init__.py +0 -0
  17. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/__init__.py +0 -0
  18. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/new.py +0 -0
  19. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/show_all.py +0 -0
  20. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
  21. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
  22. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/app/piccolo_app.py +0 -0
  23. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/__init__.py +0 -0
  24. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/__init__.py +0 -0
  25. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/new.py +0 -0
  26. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
  27. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +0 -0
  28. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +0 -0
  29. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
  30. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +0 -0
  31. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +0 -0
  32. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
  33. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +0 -0
  34. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
  35. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
  36. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
  37. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
  38. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +0 -0
  39. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
  40. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
  41. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +0 -0
  42. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
  43. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
  44. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
  45. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
  46. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +0 -0
  47. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
  48. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
  49. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
  50. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
  51. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
  52. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
  53. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/asgi/piccolo_app.py +0 -0
  54. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/__init__.py +0 -0
  55. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/__init__.py +0 -0
  56. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/dump.py +0 -0
  57. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/load.py +0 -0
  58. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/commands/shared.py +0 -0
  59. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/fixtures/piccolo_app.py +0 -0
  60. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/__init__.py +0 -0
  61. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/commands/__init__.py +0 -0
  62. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/commands/version.py +0 -0
  63. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/meta/piccolo_app.py +0 -0
  64. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/__init__.py +0 -0
  65. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/__init__.py +0 -0
  66. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
  67. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/migration_manager.py +0 -0
  68. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/operations.py +0 -0
  69. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
  70. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
  71. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/serialisation.py +0 -0
  72. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
  73. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/__init__.py +0 -0
  74. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/backwards.py +0 -0
  75. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/base.py +0 -0
  76. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/check.py +0 -0
  77. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/clean.py +0 -0
  78. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/forwards.py +0 -0
  79. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/new.py +0 -0
  80. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
  81. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/piccolo_app.py +0 -0
  82. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/migrations/tables.py +0 -0
  83. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/__init__.py +0 -0
  84. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/commands/__init__.py +0 -0
  85. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/playground/piccolo_app.py +0 -0
  86. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/__init__.py +0 -0
  87. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/commands/__init__.py +0 -0
  88. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/commands/new.py +0 -0
  89. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
  90. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/project/piccolo_app.py +0 -0
  91. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/__init__.py +0 -0
  92. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/__init__.py +0 -0
  93. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/exceptions.py +0 -0
  94. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/generate.py +0 -0
  95. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/graph.py +0 -0
  96. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
  97. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/schema/piccolo_app.py +0 -0
  98. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/__init__.py +0 -0
  99. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/commands/__init__.py +0 -0
  100. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/commands/run.py +0 -0
  101. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/shell/piccolo_app.py +0 -0
  102. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/__init__.py +0 -0
  103. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
  104. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/commands/run.py +0 -0
  105. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
  106. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/__init__.py +0 -0
  107. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/commands/__init__.py +0 -0
  108. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/commands/run.py +0 -0
  109. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/tester/piccolo_app.py +0 -0
  110. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/__init__.py +0 -0
  111. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/__init__.py +0 -0
  112. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/change_password.py +0 -0
  113. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/change_permissions.py +0 -0
  114. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/create.py +0 -0
  115. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/commands/list.py +0 -0
  116. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_app.py +0 -0
  117. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
  118. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
  119. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
  120. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
  121. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/apps/user/tables.py +0 -0
  122. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/__init__.py +0 -0
  123. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/base.py +0 -0
  124. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/choices.py +0 -0
  125. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/column_types.py +0 -0
  126. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/combination.py +0 -0
  127. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/__init__.py +0 -0
  128. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/base.py +0 -0
  129. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/date.py +0 -0
  130. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/interval.py +0 -0
  131. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/time.py +0 -0
  132. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/timestamp.py +0 -0
  133. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/timestamptz.py +0 -0
  134. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/defaults/uuid.py +0 -0
  135. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/indexes.py +0 -0
  136. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/m2m.py +0 -0
  137. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/__init__.py +0 -0
  138. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/base.py +0 -0
  139. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/comparison.py +0 -0
  140. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/math.py +0 -0
  141. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/operators/string.py +0 -0
  142. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/readable.py +0 -0
  143. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/columns/reference.py +0 -0
  144. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/conf/__init__.py +0 -0
  145. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/conf/apps.py +0 -0
  146. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/custom_types.py +0 -0
  147. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/__init__.py +0 -0
  148. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/base.py +0 -0
  149. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/cockroach.py +0 -0
  150. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/exceptions.py +0 -0
  151. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/finder.py +0 -0
  152. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/postgres.py +0 -0
  153. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/engine/sqlite.py +0 -0
  154. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/main.py +0 -0
  155. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/py.typed +0 -0
  156. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/__init__.py +0 -0
  157. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/__init__.py +0 -0
  158. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/alter.py +0 -0
  159. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/count.py +0 -0
  160. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/create.py +0 -0
  161. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/create_index.py +0 -0
  162. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/delete.py +0 -0
  163. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/drop_index.py +0 -0
  164. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/exists.py +0 -0
  165. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/indexes.py +0 -0
  166. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/insert.py +0 -0
  167. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/objects.py +0 -0
  168. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/raw.py +0 -0
  169. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/refresh.py +0 -0
  170. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/select.py +0 -0
  171. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/table_exists.py +0 -0
  172. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/methods/update.py +0 -0
  173. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/mixins.py +0 -0
  174. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/query/proxy.py +0 -0
  175. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/querystring.py +0 -0
  176. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/schema.py +0 -0
  177. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/table.py +0 -0
  178. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/table_reflection.py +0 -0
  179. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/testing/__init__.py +0 -0
  180. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/testing/model_builder.py +0 -0
  181. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/testing/random_builder.py +0 -0
  182. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/__init__.py +0 -0
  183. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/dictionary.py +0 -0
  184. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/encoding.py +0 -0
  185. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/graphlib/__init__.py +0 -0
  186. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/graphlib/_graphlib.py +0 -0
  187. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/lazy_loader.py +0 -0
  188. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/list.py +0 -0
  189. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/naming.py +0 -0
  190. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/objects.py +0 -0
  191. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/printing.py +0 -0
  192. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/pydantic.py +0 -0
  193. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/repr.py +0 -0
  194. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/sql_values.py +0 -0
  195. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/sync.py +0 -0
  196. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo/utils/warnings.py +0 -0
  197. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/SOURCES.txt +0 -0
  198. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/dependency_links.txt +0 -0
  199. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/entry_points.txt +0 -0
  200. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/requires.txt +0 -0
  201. {piccolo-1.5.1 → piccolo-1.5.2}/piccolo.egg-info/top_level.txt +0 -0
  202. {piccolo-1.5.1 → piccolo-1.5.2}/profiling/__init__.py +0 -0
  203. {piccolo-1.5.1 → piccolo-1.5.2}/profiling/run_profile.py +0 -0
  204. {piccolo-1.5.1 → piccolo-1.5.2}/pyproject.toml +0 -0
  205. {piccolo-1.5.1 → piccolo-1.5.2}/setup.cfg +0 -0
  206. {piccolo-1.5.1 → piccolo-1.5.2}/setup.py +0 -0
  207. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/__init__.py +0 -0
  208. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/__init__.py +0 -0
  209. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/commands/__init__.py +0 -0
  210. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/commands/test_new.py +0 -0
  211. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/app/commands/test_show_all.py +0 -0
  212. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/asgi/__init__.py +0 -0
  213. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/asgi/commands/__init__.py +0 -0
  214. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/asgi/commands/test_new.py +0 -0
  215. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/__init__.py +0 -0
  216. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/commands/__init__.py +0 -0
  217. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
  218. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/fixtures/commands/test_shared.py +0 -0
  219. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/meta/__init__.py +0 -0
  220. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/meta/commands/__init__.py +0 -0
  221. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/meta/commands/test_version.py +0 -0
  222. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/__init__.py +0 -0
  223. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/__init__.py +0 -0
  224. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/integration/__init__.py +0 -0
  225. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/integration/test_migrations.py +0 -0
  226. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
  227. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_migration_manager.py +0 -0
  228. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
  229. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
  230. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/auto/test_serialisation.py +0 -0
  231. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/__init__.py +0 -0
  232. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_base.py +0 -0
  233. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_check.py +0 -0
  234. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_clean.py +0 -0
  235. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
  236. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
  237. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/commands/test_new.py +0 -0
  238. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/migrations/test_migration.py +0 -0
  239. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/project/__init__.py +0 -0
  240. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/project/commands/__init__.py +0 -0
  241. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/project/commands/test_new.py +0 -0
  242. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/schema/__init__.py +0 -0
  243. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/shell/__init__.py +0 -0
  244. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/shell/commands/__init__.py +0 -0
  245. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/sql_shell/__init__.py +0 -0
  246. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/sql_shell/commands/__init__.py +0 -0
  247. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/sql_shell/commands/test_run.py +0 -0
  248. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/tester/__init__.py +0 -0
  249. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/__init__.py +0 -0
  250. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/__init__.py +0 -0
  251. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_change_password.py +0 -0
  252. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_change_permissions.py +0 -0
  253. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_create.py +0 -0
  254. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/commands/test_list.py +0 -0
  255. {piccolo-1.5.1 → piccolo-1.5.2}/tests/apps/user/test_tables.py +0 -0
  256. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/__init__.py +0 -0
  257. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/__init__.py +0 -0
  258. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/base.py +0 -0
  259. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/test_m2m.py +0 -0
  260. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/m2m/test_m2m_schema.py +0 -0
  261. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_array.py +0 -0
  262. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_base.py +0 -0
  263. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_bigint.py +0 -0
  264. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_boolean.py +0 -0
  265. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_bytea.py +0 -0
  266. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_choices.py +0 -0
  267. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_combination.py +0 -0
  268. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_date.py +0 -0
  269. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_db_column_name.py +0 -0
  270. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_defaults.py +0 -0
  271. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_double_precision.py +0 -0
  272. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_interval.py +0 -0
  273. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_json.py +0 -0
  274. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_jsonb.py +0 -0
  275. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_numeric.py +0 -0
  276. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_primary_key.py +0 -0
  277. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_readable.py +0 -0
  278. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_real.py +0 -0
  279. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_reference.py +0 -0
  280. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_reserved_column_names.py +0 -0
  281. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_smallint.py +0 -0
  282. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_time.py +0 -0
  283. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_timestamp.py +0 -0
  284. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_timestamptz.py +0 -0
  285. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_uuid.py +0 -0
  286. {piccolo-1.5.1 → piccolo-1.5.2}/tests/columns/test_varchar.py +0 -0
  287. {piccolo-1.5.1 → piccolo-1.5.2}/tests/conf/__init__.py +0 -0
  288. {piccolo-1.5.1 → piccolo-1.5.2}/tests/conf/example.py +0 -0
  289. {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/__init__.py +0 -0
  290. {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_extra_nodes.py +0 -0
  291. {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_logging.py +0 -0
  292. {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_nested_transaction.py +0 -0
  293. {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_pool.py +0 -0
  294. {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_transaction.py +0 -0
  295. {piccolo-1.5.1 → piccolo-1.5.2}/tests/engine/test_version_parsing.py +0 -0
  296. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/__init__.py +0 -0
  297. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/__init__.py +0 -0
  298. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_app.py +0 -0
  299. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
  300. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
  301. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/mega/tables.py +0 -0
  302. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/__init__.py +0 -0
  303. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/piccolo_app.py +0 -0
  304. {piccolo-1.5.1 → piccolo-1.5.2}/tests/example_apps/music/tables_detailed.py +0 -0
  305. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/__init__.py +0 -0
  306. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/mixins/__init__.py +0 -0
  307. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/mixins/test_columns_delegate.py +0 -0
  308. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/mixins/test_order_by_delegate.py +0 -0
  309. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_await.py +0 -0
  310. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_camelcase.py +0 -0
  311. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_freeze.py +0 -0
  312. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_gather.py +0 -0
  313. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_querystring.py +0 -0
  314. {piccolo-1.5.1 → piccolo-1.5.2}/tests/query/test_slots.py +0 -0
  315. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/__init__.py +0 -0
  316. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/__init__.py +0 -0
  317. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_create.py +0 -0
  318. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_get_related.py +0 -0
  319. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_get_related_readable.py +0 -0
  320. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_instantiate.py +0 -0
  321. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_remove.py +0 -0
  322. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_save.py +0 -0
  323. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/instance/test_to_dict.py +0 -0
  324. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_all_columns.py +0 -0
  325. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_alter.py +0 -0
  326. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_batch.py +0 -0
  327. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_callback.py +0 -0
  328. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_constructor.py +0 -0
  329. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_count.py +0 -0
  330. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_create.py +0 -0
  331. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_create_db_tables.py +0 -0
  332. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_create_table_class.py +0 -0
  333. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_delete.py +0 -0
  334. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_drop_db_tables.py +0 -0
  335. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_exists.py +0 -0
  336. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_from_dict.py +0 -0
  337. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_indexes.py +0 -0
  338. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_inheritance.py +0 -0
  339. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_insert.py +0 -0
  340. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_join.py +0 -0
  341. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_join_on.py +0 -0
  342. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_metaclass.py +0 -0
  343. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_objects.py +0 -0
  344. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_raw.py +0 -0
  345. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_ref.py +0 -0
  346. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_refresh.py +0 -0
  347. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_repr.py +0 -0
  348. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_select.py +0 -0
  349. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_str.py +0 -0
  350. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_table_exists.py +0 -0
  351. {piccolo-1.5.1 → piccolo-1.5.2}/tests/table/test_update.py +0 -0
  352. {piccolo-1.5.1 → piccolo-1.5.2}/tests/test_main.py +0 -0
  353. {piccolo-1.5.1 → piccolo-1.5.2}/tests/test_schema.py +0 -0
  354. {piccolo-1.5.1 → piccolo-1.5.2}/tests/testing/__init__.py +0 -0
  355. {piccolo-1.5.1 → piccolo-1.5.2}/tests/testing/test_model_builder.py +0 -0
  356. {piccolo-1.5.1 → piccolo-1.5.2}/tests/testing/test_random_builder.py +0 -0
  357. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/__init__.py +0 -0
  358. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_dictionary.py +0 -0
  359. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_encoding.py +0 -0
  360. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_lazy_loader.py +0 -0
  361. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_list.py +0 -0
  362. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_naming.py +0 -0
  363. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_printing.py +0 -0
  364. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_pydantic.py +0 -0
  365. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_sql_values.py +0 -0
  366. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_sync.py +0 -0
  367. {piccolo-1.5.1 → piccolo-1.5.2}/tests/utils/test_table_reflection.py +0 -0
  368. {piccolo-1.5.1 → 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.1
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
@@ -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
- 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.1
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
@@ -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"),
@@ -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