piccolo 1.19.0__tar.gz → 1.20.0__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 (386) hide show
  1. {piccolo-1.19.0 → piccolo-1.20.0}/PKG-INFO +1 -1
  2. piccolo-1.20.0/piccolo/__init__.py +1 -0
  3. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/new.py +2 -2
  4. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +9 -13
  5. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +14 -24
  6. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +6 -7
  7. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +32 -11
  8. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/m2m.py +6 -2
  9. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/objects.py +58 -1
  10. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/table.py +7 -18
  11. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo.egg-info/PKG-INFO +1 -1
  12. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/m2m/base.py +16 -0
  13. piccolo-1.20.0/tests/table/instance/test_get_related.py +98 -0
  14. piccolo-1.19.0/piccolo/__init__.py +0 -1
  15. piccolo-1.19.0/tests/table/instance/test_get_related.py +0 -42
  16. {piccolo-1.19.0 → piccolo-1.20.0}/LICENSE +0 -0
  17. {piccolo-1.19.0 → piccolo-1.20.0}/README.md +0 -0
  18. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/__init__.py +0 -0
  19. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/app/__init__.py +0 -0
  20. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/app/commands/__init__.py +0 -0
  21. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/app/commands/new.py +0 -0
  22. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/app/commands/show_all.py +0 -0
  23. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
  24. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
  25. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/app/piccolo_app.py +0 -0
  26. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/__init__.py +0 -0
  27. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/__init__.py +0 -0
  28. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
  29. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
  30. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
  31. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +0 -0
  32. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
  33. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
  34. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
  35. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
  36. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +0 -0
  37. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
  38. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
  39. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +0 -0
  40. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
  41. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
  42. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
  43. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
  44. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +0 -0
  45. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
  46. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
  47. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
  48. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
  49. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
  50. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
  51. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/asgi/piccolo_app.py +0 -0
  52. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/fixtures/__init__.py +0 -0
  53. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/fixtures/commands/__init__.py +0 -0
  54. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/fixtures/commands/dump.py +0 -0
  55. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/fixtures/commands/load.py +0 -0
  56. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/fixtures/commands/shared.py +0 -0
  57. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/fixtures/piccolo_app.py +0 -0
  58. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/meta/__init__.py +0 -0
  59. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/meta/commands/__init__.py +0 -0
  60. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/meta/commands/version.py +0 -0
  61. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/meta/piccolo_app.py +0 -0
  62. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/__init__.py +0 -0
  63. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/__init__.py +0 -0
  64. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
  65. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/migration_manager.py +0 -0
  66. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/operations.py +0 -0
  67. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
  68. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
  69. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/serialisation.py +0 -0
  70. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
  71. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/__init__.py +0 -0
  72. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/backwards.py +0 -0
  73. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/base.py +0 -0
  74. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/check.py +0 -0
  75. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/clean.py +0 -0
  76. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/forwards.py +0 -0
  77. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/new.py +0 -0
  78. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
  79. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/piccolo_app.py +0 -0
  80. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/migrations/tables.py +0 -0
  81. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/playground/__init__.py +0 -0
  82. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/playground/commands/__init__.py +0 -0
  83. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/playground/commands/run.py +0 -0
  84. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/playground/piccolo_app.py +0 -0
  85. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/project/__init__.py +0 -0
  86. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/project/commands/__init__.py +0 -0
  87. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/project/commands/new.py +0 -0
  88. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
  89. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/project/piccolo_app.py +0 -0
  90. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/schema/__init__.py +0 -0
  91. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/schema/commands/__init__.py +0 -0
  92. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/schema/commands/exceptions.py +0 -0
  93. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/schema/commands/generate.py +0 -0
  94. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/schema/commands/graph.py +0 -0
  95. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
  96. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/schema/piccolo_app.py +0 -0
  97. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/shell/__init__.py +0 -0
  98. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/shell/commands/__init__.py +0 -0
  99. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/shell/commands/run.py +0 -0
  100. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/shell/piccolo_app.py +0 -0
  101. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/sql_shell/__init__.py +0 -0
  102. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
  103. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/sql_shell/commands/run.py +0 -0
  104. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
  105. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/tester/__init__.py +0 -0
  106. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/tester/commands/__init__.py +0 -0
  107. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/tester/commands/run.py +0 -0
  108. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/tester/piccolo_app.py +0 -0
  109. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/__init__.py +0 -0
  110. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/commands/__init__.py +0 -0
  111. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/commands/change_password.py +0 -0
  112. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/commands/change_permissions.py +0 -0
  113. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/commands/create.py +0 -0
  114. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/commands/list.py +0 -0
  115. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/piccolo_app.py +0 -0
  116. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
  117. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
  118. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
  119. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
  120. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/apps/user/tables.py +0 -0
  121. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/__init__.py +0 -0
  122. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/base.py +0 -0
  123. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/choices.py +0 -0
  124. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/column_types.py +0 -0
  125. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/combination.py +0 -0
  126. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/__init__.py +0 -0
  127. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/base.py +0 -0
  128. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/date.py +0 -0
  129. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/interval.py +0 -0
  130. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/time.py +0 -0
  131. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/timestamp.py +0 -0
  132. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/timestamptz.py +0 -0
  133. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/defaults/uuid.py +0 -0
  134. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/indexes.py +0 -0
  135. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/operators/__init__.py +0 -0
  136. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/operators/base.py +0 -0
  137. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/operators/comparison.py +0 -0
  138. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/operators/math.py +0 -0
  139. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/operators/string.py +0 -0
  140. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/readable.py +0 -0
  141. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/columns/reference.py +0 -0
  142. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/conf/__init__.py +0 -0
  143. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/conf/apps.py +0 -0
  144. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/custom_types.py +0 -0
  145. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/engine/__init__.py +0 -0
  146. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/engine/base.py +0 -0
  147. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/engine/cockroach.py +0 -0
  148. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/engine/exceptions.py +0 -0
  149. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/engine/finder.py +0 -0
  150. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/engine/postgres.py +0 -0
  151. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/engine/sqlite.py +0 -0
  152. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/main.py +0 -0
  153. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/py.typed +0 -0
  154. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/__init__.py +0 -0
  155. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/base.py +0 -0
  156. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/functions/__init__.py +0 -0
  157. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/functions/aggregate.py +0 -0
  158. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/functions/base.py +0 -0
  159. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/functions/datetime.py +0 -0
  160. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/functions/math.py +0 -0
  161. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/functions/string.py +0 -0
  162. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/functions/type_conversion.py +0 -0
  163. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/__init__.py +0 -0
  164. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/alter.py +0 -0
  165. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/count.py +0 -0
  166. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/create.py +0 -0
  167. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/create_index.py +0 -0
  168. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/delete.py +0 -0
  169. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/drop_index.py +0 -0
  170. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/exists.py +0 -0
  171. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/indexes.py +0 -0
  172. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/insert.py +0 -0
  173. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/raw.py +0 -0
  174. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/refresh.py +0 -0
  175. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/select.py +0 -0
  176. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/table_exists.py +0 -0
  177. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/methods/update.py +0 -0
  178. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/mixins.py +0 -0
  179. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/query/proxy.py +0 -0
  180. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/querystring.py +0 -0
  181. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/schema.py +0 -0
  182. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/table_reflection.py +0 -0
  183. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/testing/__init__.py +0 -0
  184. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/testing/model_builder.py +0 -0
  185. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/testing/random_builder.py +0 -0
  186. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/testing/test_case.py +0 -0
  187. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/__init__.py +0 -0
  188. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/dictionary.py +0 -0
  189. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/encoding.py +0 -0
  190. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/graphlib/__init__.py +0 -0
  191. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/graphlib/_graphlib.py +0 -0
  192. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/lazy_loader.py +0 -0
  193. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/list.py +0 -0
  194. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/naming.py +0 -0
  195. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/objects.py +0 -0
  196. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/printing.py +0 -0
  197. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/pydantic.py +0 -0
  198. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/repr.py +0 -0
  199. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/sql_values.py +0 -0
  200. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/sync.py +0 -0
  201. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo/utils/warnings.py +0 -0
  202. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo.egg-info/SOURCES.txt +0 -0
  203. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo.egg-info/dependency_links.txt +0 -0
  204. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo.egg-info/entry_points.txt +0 -0
  205. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo.egg-info/requires.txt +0 -0
  206. {piccolo-1.19.0 → piccolo-1.20.0}/piccolo.egg-info/top_level.txt +0 -0
  207. {piccolo-1.19.0 → piccolo-1.20.0}/profiling/__init__.py +0 -0
  208. {piccolo-1.19.0 → piccolo-1.20.0}/profiling/run_profile.py +0 -0
  209. {piccolo-1.19.0 → piccolo-1.20.0}/pyproject.toml +0 -0
  210. {piccolo-1.19.0 → piccolo-1.20.0}/setup.cfg +0 -0
  211. {piccolo-1.19.0 → piccolo-1.20.0}/setup.py +0 -0
  212. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/__init__.py +0 -0
  213. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/app/__init__.py +0 -0
  214. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/app/commands/__init__.py +0 -0
  215. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/app/commands/test_new.py +0 -0
  216. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/app/commands/test_show_all.py +0 -0
  217. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/asgi/__init__.py +0 -0
  218. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/asgi/commands/__init__.py +0 -0
  219. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/asgi/commands/test_new.py +0 -0
  220. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/fixtures/__init__.py +0 -0
  221. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/fixtures/commands/__init__.py +0 -0
  222. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
  223. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/fixtures/commands/test_shared.py +0 -0
  224. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/meta/__init__.py +0 -0
  225. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/meta/commands/__init__.py +0 -0
  226. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/meta/commands/test_version.py +0 -0
  227. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/__init__.py +0 -0
  228. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/__init__.py +0 -0
  229. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/integration/__init__.py +0 -0
  230. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/integration/test_migrations.py +0 -0
  231. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
  232. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/test_migration_manager.py +0 -0
  233. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
  234. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
  235. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/auto/test_serialisation.py +0 -0
  236. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/__init__.py +0 -0
  237. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/test_base.py +0 -0
  238. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/test_check.py +0 -0
  239. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/test_clean.py +0 -0
  240. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/test_forwards_backwards.py +0 -0
  241. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
  242. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
  243. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/commands/test_new.py +0 -0
  244. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/migrations/test_migration.py +0 -0
  245. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/project/__init__.py +0 -0
  246. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/project/commands/__init__.py +0 -0
  247. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/project/commands/test_new.py +0 -0
  248. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/schema/__init__.py +0 -0
  249. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/shell/__init__.py +0 -0
  250. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/shell/commands/__init__.py +0 -0
  251. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/shell/commands/test_run.py +0 -0
  252. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/sql_shell/__init__.py +0 -0
  253. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/sql_shell/commands/__init__.py +0 -0
  254. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/sql_shell/commands/test_run.py +0 -0
  255. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/tester/__init__.py +0 -0
  256. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/user/__init__.py +0 -0
  257. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/user/commands/__init__.py +0 -0
  258. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/user/commands/test_change_password.py +0 -0
  259. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/user/commands/test_change_permissions.py +0 -0
  260. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/user/commands/test_create.py +0 -0
  261. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/user/commands/test_list.py +0 -0
  262. {piccolo-1.19.0 → piccolo-1.20.0}/tests/apps/user/test_tables.py +0 -0
  263. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/__init__.py +0 -0
  264. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/m2m/__init__.py +0 -0
  265. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/m2m/test_m2m.py +0 -0
  266. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/m2m/test_m2m_schema.py +0 -0
  267. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_array.py +0 -0
  268. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_base.py +0 -0
  269. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_bigint.py +0 -0
  270. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_boolean.py +0 -0
  271. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_bytea.py +0 -0
  272. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_choices.py +0 -0
  273. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_combination.py +0 -0
  274. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_date.py +0 -0
  275. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_db_column_name.py +0 -0
  276. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_defaults.py +0 -0
  277. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_double_precision.py +0 -0
  278. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_get_sql_value.py +0 -0
  279. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_interval.py +0 -0
  280. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_json.py +0 -0
  281. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_jsonb.py +0 -0
  282. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_numeric.py +0 -0
  283. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_primary_key.py +0 -0
  284. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_readable.py +0 -0
  285. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_real.py +0 -0
  286. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_reference.py +0 -0
  287. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_reserved_column_names.py +0 -0
  288. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_smallint.py +0 -0
  289. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_time.py +0 -0
  290. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_timestamp.py +0 -0
  291. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_timestamptz.py +0 -0
  292. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_uuid.py +0 -0
  293. {piccolo-1.19.0 → piccolo-1.20.0}/tests/columns/test_varchar.py +0 -0
  294. {piccolo-1.19.0 → piccolo-1.20.0}/tests/conf/__init__.py +0 -0
  295. {piccolo-1.19.0 → piccolo-1.20.0}/tests/conf/example.py +0 -0
  296. {piccolo-1.19.0 → piccolo-1.20.0}/tests/conf/test_apps.py +0 -0
  297. {piccolo-1.19.0 → piccolo-1.20.0}/tests/engine/__init__.py +0 -0
  298. {piccolo-1.19.0 → piccolo-1.20.0}/tests/engine/test_extra_nodes.py +0 -0
  299. {piccolo-1.19.0 → piccolo-1.20.0}/tests/engine/test_logging.py +0 -0
  300. {piccolo-1.19.0 → piccolo-1.20.0}/tests/engine/test_nested_transaction.py +0 -0
  301. {piccolo-1.19.0 → piccolo-1.20.0}/tests/engine/test_pool.py +0 -0
  302. {piccolo-1.19.0 → piccolo-1.20.0}/tests/engine/test_transaction.py +0 -0
  303. {piccolo-1.19.0 → piccolo-1.20.0}/tests/engine/test_version_parsing.py +0 -0
  304. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/__init__.py +0 -0
  305. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/mega/__init__.py +0 -0
  306. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/mega/piccolo_app.py +0 -0
  307. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
  308. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
  309. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/mega/tables.py +0 -0
  310. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/music/__init__.py +0 -0
  311. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/music/piccolo_app.py +0 -0
  312. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/music/tables.py +0 -0
  313. {piccolo-1.19.0 → piccolo-1.20.0}/tests/example_apps/music/tables_detailed.py +0 -0
  314. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/__init__.py +0 -0
  315. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/functions/__init__.py +0 -0
  316. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/functions/base.py +0 -0
  317. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/functions/test_datetime.py +0 -0
  318. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/functions/test_functions.py +0 -0
  319. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/functions/test_math.py +0 -0
  320. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/functions/test_string.py +0 -0
  321. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/functions/test_type_conversion.py +0 -0
  322. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/mixins/__init__.py +0 -0
  323. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/mixins/test_columns_delegate.py +0 -0
  324. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/mixins/test_order_by_delegate.py +0 -0
  325. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/test_await.py +0 -0
  326. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/test_camelcase.py +0 -0
  327. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/test_freeze.py +0 -0
  328. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/test_gather.py +0 -0
  329. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/test_querystring.py +0 -0
  330. {piccolo-1.19.0 → piccolo-1.20.0}/tests/query/test_slots.py +0 -0
  331. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/__init__.py +0 -0
  332. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/instance/__init__.py +0 -0
  333. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/instance/test_create.py +0 -0
  334. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/instance/test_get_related_readable.py +0 -0
  335. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/instance/test_instantiate.py +0 -0
  336. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/instance/test_remove.py +0 -0
  337. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/instance/test_save.py +0 -0
  338. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/instance/test_to_dict.py +0 -0
  339. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_all_columns.py +0 -0
  340. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_alter.py +0 -0
  341. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_batch.py +0 -0
  342. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_callback.py +0 -0
  343. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_constructor.py +0 -0
  344. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_count.py +0 -0
  345. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_create.py +0 -0
  346. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_create_db_tables.py +0 -0
  347. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_create_table_class.py +0 -0
  348. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_delete.py +0 -0
  349. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_drop_db_tables.py +0 -0
  350. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_exists.py +0 -0
  351. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_from_dict.py +0 -0
  352. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_indexes.py +0 -0
  353. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_inheritance.py +0 -0
  354. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_insert.py +0 -0
  355. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_join.py +0 -0
  356. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_join_on.py +0 -0
  357. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_metaclass.py +0 -0
  358. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_objects.py +0 -0
  359. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_output.py +0 -0
  360. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_raw.py +0 -0
  361. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_ref.py +0 -0
  362. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_refresh.py +0 -0
  363. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_repr.py +0 -0
  364. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_select.py +0 -0
  365. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_str.py +0 -0
  366. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_table_exists.py +0 -0
  367. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_update.py +0 -0
  368. {piccolo-1.19.0 → piccolo-1.20.0}/tests/table/test_update_self.py +0 -0
  369. {piccolo-1.19.0 → piccolo-1.20.0}/tests/test_main.py +0 -0
  370. {piccolo-1.19.0 → piccolo-1.20.0}/tests/test_schema.py +0 -0
  371. {piccolo-1.19.0 → piccolo-1.20.0}/tests/testing/__init__.py +0 -0
  372. {piccolo-1.19.0 → piccolo-1.20.0}/tests/testing/test_model_builder.py +0 -0
  373. {piccolo-1.19.0 → piccolo-1.20.0}/tests/testing/test_random_builder.py +0 -0
  374. {piccolo-1.19.0 → piccolo-1.20.0}/tests/testing/test_test_case.py +0 -0
  375. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/__init__.py +0 -0
  376. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_dictionary.py +0 -0
  377. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_encoding.py +0 -0
  378. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_lazy_loader.py +0 -0
  379. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_list.py +0 -0
  380. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_naming.py +0 -0
  381. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_printing.py +0 -0
  382. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_pydantic.py +0 -0
  383. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_sql_values.py +0 -0
  384. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_sync.py +0 -0
  385. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_table_reflection.py +0 -0
  386. {piccolo-1.19.0 → piccolo-1.20.0}/tests/utils/test_warnings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 1.19.0
3
+ Version: 1.20.0
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.20.0"
@@ -12,10 +12,10 @@ TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates/app/")
12
12
  SERVERS = ["uvicorn", "Hypercorn", "granian"]
13
13
  ROUTER_DEPENDENCIES = {
14
14
  "starlette": ["starlette"],
15
- "fastapi": ["fastapi>=0.112.1"],
15
+ "fastapi": ["fastapi"],
16
16
  "blacksheep": ["blacksheep"],
17
17
  "litestar": ["litestar"],
18
- "esmerald": ["esmerald==3.3.0"],
18
+ "esmerald": ["esmerald"],
19
19
  "lilya": ["lilya"],
20
20
  }
21
21
  ROUTERS = list(ROUTER_DEPENDENCIES.keys())
@@ -1,20 +1,18 @@
1
1
  import typing as t
2
2
 
3
- from piccolo_admin.endpoints import create_admin
4
- from piccolo_api.crud.serializers import create_pydantic_model
5
- from piccolo.engine import engine_finder
6
-
7
3
  from blacksheep.server import Application
8
4
  from blacksheep.server.bindings import FromJSON
9
- from blacksheep.server.responses import json
10
5
  from blacksheep.server.openapi.v3 import OpenAPIHandler
6
+ from blacksheep.server.responses import json
11
7
  from openapidocs.v3 import Info
8
+ from piccolo.engine import engine_finder
9
+ from piccolo_admin.endpoints import create_admin
10
+ from piccolo_api.crud.serializers import create_pydantic_model
12
11
 
13
12
  from home.endpoints import home
14
13
  from home.piccolo_app import APP_CONFIG
15
14
  from home.tables import Task
16
15
 
17
-
18
16
  app = Application()
19
17
 
20
18
  app.mount(
@@ -47,7 +45,7 @@ TaskModelPartial: t.Any = create_pydantic_model(
47
45
 
48
46
  @app.router.get("/tasks/")
49
47
  async def tasks() -> t.List[TaskModelOut]:
50
- return await Task.select().order_by(Task.id)
48
+ return await Task.select().order_by(Task._meta.primary_key, ascending=False)
51
49
 
52
50
 
53
51
  @app.router.post("/tasks/")
@@ -58,10 +56,8 @@ async def create_task(task_model: FromJSON[TaskModelIn]) -> TaskModelOut:
58
56
 
59
57
 
60
58
  @app.router.put("/tasks/{task_id}/")
61
- async def put_task(
62
- task_id: int, task_model: FromJSON[TaskModelIn]
63
- ) -> TaskModelOut:
64
- task = await Task.objects().get(Task.id == task_id)
59
+ async def put_task(task_id: int, task_model: FromJSON[TaskModelIn]) -> TaskModelOut:
60
+ task = await Task.objects().get(Task._meta.primary_key == task_id)
65
61
  if not task:
66
62
  return json({}, status=404)
67
63
 
@@ -77,7 +73,7 @@ async def put_task(
77
73
  async def patch_task(
78
74
  task_id: int, task_model: FromJSON[TaskModelPartial]
79
75
  ) -> TaskModelOut:
80
- task = await Task.objects().get(Task.id == task_id)
76
+ task = await Task.objects().get(Task._meta.primary_key == task_id)
81
77
  if not task:
82
78
  return json({}, status=404)
83
79
 
@@ -92,7 +88,7 @@ async def patch_task(
92
88
 
93
89
  @app.router.delete("/tasks/{task_id}/")
94
90
  async def delete_task(task_id: int):
95
- task = await Task.objects().get(Task.id == task_id)
91
+ task = await Task.objects().get(Task._meta.primary_key == task_id)
96
92
  if not task:
97
93
  return json({}, status=404)
98
94
 
@@ -1,23 +1,21 @@
1
1
  import typing as t
2
-
3
2
  from pathlib import Path
4
3
 
5
- from piccolo.utils.pydantic import create_pydantic_model
6
- from piccolo.engine import engine_finder
7
- from piccolo_admin.endpoints import create_admin
8
-
9
4
  from esmerald import (
5
+ APIView,
10
6
  Esmerald,
11
- Include,
12
7
  Gateway,
8
+ Include,
13
9
  JSONResponse,
14
- APIView,
10
+ delete,
15
11
  get,
16
12
  post,
17
13
  put,
18
- delete
19
14
  )
20
15
  from esmerald.config import StaticFilesConfig
16
+ from piccolo.engine import engine_finder
17
+ from piccolo.utils.pydantic import create_pydantic_model
18
+ from piccolo_admin.endpoints import create_admin
21
19
 
22
20
  from home.endpoints import home
23
21
  from home.piccolo_app import APP_CONFIG
@@ -40,14 +38,9 @@ async def close_database_connection_pool():
40
38
  print("Unable to connect to the database")
41
39
 
42
40
 
43
- TaskModelIn: t.Any = create_pydantic_model(
44
- table=Task,
45
- model_name='TaskModelIn'
46
- )
41
+ TaskModelIn: t.Any = create_pydantic_model(table=Task, model_name="TaskModelIn")
47
42
  TaskModelOut: t.Any = create_pydantic_model(
48
- table=Task,
49
- include_default_columns=True,
50
- model_name='TaskModelOut'
43
+ table=Task, include_default_columns=True, model_name="TaskModelOut"
51
44
  )
52
45
 
53
46
 
@@ -57,19 +50,17 @@ class TaskAPIView(APIView):
57
50
 
58
51
  @get("/")
59
52
  async def tasks(self) -> t.List[TaskModelOut]:
60
- return await Task.select().order_by(Task.id)
61
-
53
+ return await Task.select().order_by(Task._meta.primary_key, ascending=False)
62
54
 
63
- @post('/')
55
+ @post("/")
64
56
  async def create_task(self, payload: TaskModelIn) -> TaskModelOut:
65
57
  task = Task(**payload.dict())
66
58
  await task.save()
67
59
  return task.to_dict()
68
60
 
69
-
70
- @put('/{task_id}')
61
+ @put("/{task_id}")
71
62
  async def update_task(self, payload: TaskModelIn, task_id: int) -> TaskModelOut:
72
- task = await Task.objects().get(Task.id == task_id)
63
+ task = await Task.objects().get(Task._meta.primary_key == task_id)
73
64
  if not task:
74
65
  return JSONResponse({}, status_code=404)
75
66
 
@@ -80,10 +71,9 @@ class TaskAPIView(APIView):
80
71
 
81
72
  return task.to_dict()
82
73
 
83
-
84
- @delete('/{task_id}')
74
+ @delete("/{task_id}")
85
75
  async def delete_task(self, task_id: int) -> None:
86
- task = await Task.objects().get(Task.id == task_id)
76
+ task = await Task.objects().get(Task._meta.primary_key == task_id)
87
77
  if not task:
88
78
  return JSONResponse({}, status_code=404)
89
79
 
@@ -1,15 +1,14 @@
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
1
  from lilya.apps import Lilya
2
+ from lilya.routing import Include, Path
6
3
  from lilya.staticfiles import StaticFiles
4
+ from piccolo.engine import engine_finder
5
+ from piccolo_admin.endpoints import create_admin
6
+ from piccolo_api.crud.endpoints import PiccoloCRUD
7
7
 
8
8
  from home.endpoints import HomeController
9
9
  from home.piccolo_app import APP_CONFIG
10
10
  from home.tables import Task
11
11
 
12
-
13
12
  app = Lilya(
14
13
  routes=[
15
14
  Path("/", HomeController),
@@ -19,10 +18,10 @@ app = Lilya(
19
18
  tables=APP_CONFIG.table_classes,
20
19
  # Required when running under HTTPS:
21
20
  # allowed_hosts=['my_site.com']
22
- )
21
+ ),
23
22
  ),
24
23
  Include("/static/", StaticFiles(directory="static")),
25
- Include("/tasks/", PiccoloCRUD(table=Task))
24
+ Include("/tasks/", PiccoloCRUD(table=Task)),
26
25
  ],
27
26
  )
28
27
 
@@ -1,8 +1,5 @@
1
1
  import typing as t
2
2
 
3
- from home.endpoints import home
4
- from home.piccolo_app import APP_CONFIG
5
- from home.tables import Task
6
3
  from litestar import Litestar, asgi, delete, get, patch, post
7
4
  from litestar.contrib.jinja import JinjaTemplateEngine
8
5
  from litestar.exceptions import NotFoundException
@@ -10,8 +7,19 @@ from litestar.static_files import StaticFilesConfig
10
7
  from litestar.template import TemplateConfig
11
8
  from litestar.types import Receive, Scope, Send
12
9
  from piccolo.engine import engine_finder
13
- from piccolo.utils.pydantic import create_pydantic_model
14
10
  from piccolo_admin.endpoints import create_admin
11
+ from pydantic import BaseModel
12
+
13
+ from home.endpoints import home
14
+ from home.piccolo_app import APP_CONFIG
15
+ from home.tables import Task
16
+
17
+ """
18
+ NOTE: `create_pydantic_model` is not compatible with Litestar
19
+ version higher than 2.11.0. If you are using Litestar<=2.11.0,
20
+ you can use `create_pydantic_model` as in other asgi templates
21
+
22
+ from piccolo.utils.pydantic import create_pydantic_model
15
23
 
16
24
  TaskModelIn: t.Any = create_pydantic_model(
17
25
  table=Task,
@@ -22,6 +30,18 @@ TaskModelOut: t.Any = create_pydantic_model(
22
30
  include_default_columns=True,
23
31
  model_name="TaskModelOut",
24
32
  )
33
+ """
34
+
35
+
36
+ class TaskModelIn(BaseModel):
37
+ name: str
38
+ completed: bool = False
39
+
40
+
41
+ class TaskModelOut(BaseModel):
42
+ id: int
43
+ name: str
44
+ completed: bool = False
25
45
 
26
46
 
27
47
  # mounting Piccolo Admin
@@ -32,31 +52,32 @@ async def admin(scope: "Scope", receive: "Receive", send: "Send") -> None:
32
52
 
33
53
  @get("/tasks", tags=["Task"])
34
54
  async def tasks() -> t.List[TaskModelOut]:
35
- return await Task.select().order_by(Task.id, ascending=False)
55
+ tasks = await Task.select().order_by(Task._meta.primary_key, ascending=False)
56
+ return [TaskModelOut(**task) for task in tasks]
36
57
 
37
58
 
38
59
  @post("/tasks", tags=["Task"])
39
60
  async def create_task(data: TaskModelIn) -> TaskModelOut:
40
- task = Task(**data.dict())
61
+ task = Task(**data.model_dump())
41
62
  await task.save()
42
- return task.to_dict()
63
+ return TaskModelOut(**task.to_dict())
43
64
 
44
65
 
45
66
  @patch("/tasks/{task_id:int}", tags=["Task"])
46
67
  async def update_task(task_id: int, data: TaskModelIn) -> TaskModelOut:
47
- task = await Task.objects().get(Task.id == task_id)
68
+ task = await Task.objects().get(Task._meta.primary_key == task_id)
48
69
  if not task:
49
70
  raise NotFoundException("Task does not exist")
50
- for key, value in data.dict().items():
71
+ for key, value in data.model_dump().items():
51
72
  setattr(task, key, value)
52
73
 
53
74
  await task.save()
54
- return task.to_dict()
75
+ return TaskModelOut(**task.to_dict())
55
76
 
56
77
 
57
78
  @delete("/tasks/{task_id:int}", tags=["Task"])
58
79
  async def delete_task(task_id: int) -> None:
59
- task = await Task.objects().get(Task.id == task_id)
80
+ task = await Task.objects().get(Task._meta.primary_key == task_id)
60
81
  if not task:
61
82
  raise NotFoundException("Task does not exist")
62
83
  await task.remove()
@@ -384,8 +384,12 @@ class M2MGetRelated:
384
384
  .output(as_list=True)
385
385
  )
386
386
 
387
- results = await secondary_table.objects().where(
388
- secondary_table._meta.primary_key.is_in(ids)
387
+ results = (
388
+ await secondary_table.objects().where(
389
+ secondary_table._meta.primary_key.is_in(ids)
390
+ )
391
+ if len(ids) > 0
392
+ else []
389
393
  )
390
394
 
391
395
  return results
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import typing as t
4
4
 
5
- from piccolo.columns.column_types import ForeignKey
5
+ from piccolo.columns.column_types import ForeignKey, ReferencedTable
6
6
  from piccolo.columns.combination import And, Where
7
7
  from piccolo.custom_types import Combinable, TableInstance
8
8
  from piccolo.engine.base import BaseBatch
@@ -231,6 +231,63 @@ class UpdateSelf:
231
231
  return run_sync(self.run(*args, **kwargs))
232
232
 
233
233
 
234
+ class GetRelated(t.Generic[ReferencedTable]):
235
+
236
+ def __init__(self, row: Table, foreign_key: ForeignKey[ReferencedTable]):
237
+ self.row = row
238
+ self.foreign_key = foreign_key
239
+
240
+ async def run(
241
+ self,
242
+ node: t.Optional[str] = None,
243
+ in_pool: bool = True,
244
+ ) -> t.Optional[ReferencedTable]:
245
+ if not self.row._exists_in_db:
246
+ raise ValueError("The object doesn't exist in the database.")
247
+
248
+ root_table = self.row.__class__
249
+
250
+ data = (
251
+ await root_table.select(
252
+ *[
253
+ i.as_alias(i._meta.name)
254
+ for i in self.foreign_key.all_columns()
255
+ ]
256
+ )
257
+ .where(
258
+ root_table._meta.primary_key
259
+ == getattr(self.row, root_table._meta.primary_key._meta.name)
260
+ )
261
+ .first()
262
+ .run(node=node, in_pool=in_pool)
263
+ )
264
+
265
+ # Make sure that some values were returned:
266
+ if data is None or not any(data.values()):
267
+ return None
268
+
269
+ references = t.cast(
270
+ t.Type[ReferencedTable],
271
+ self.foreign_key._foreign_key_meta.resolved_references,
272
+ )
273
+
274
+ referenced_object = references(**data)
275
+ referenced_object._exists_in_db = True
276
+ return referenced_object
277
+
278
+ def __await__(
279
+ self,
280
+ ) -> t.Generator[None, None, t.Optional[ReferencedTable]]:
281
+ """
282
+ If the user doesn't explicity call .run(), proxy to it as a
283
+ convenience.
284
+ """
285
+ return self.run().__await__()
286
+
287
+ def run_sync(self, *args, **kwargs) -> t.Optional[ReferencedTable]:
288
+ return run_sync(self.run(*args, **kwargs))
289
+
290
+
234
291
  ###############################################################################
235
292
 
236
293
 
@@ -46,7 +46,7 @@ from piccolo.query import (
46
46
  )
47
47
  from piccolo.query.methods.create_index import CreateIndex
48
48
  from piccolo.query.methods.indexes import Indexes
49
- from piccolo.query.methods.objects import First, UpdateSelf
49
+ from piccolo.query.methods.objects import GetRelated, UpdateSelf
50
50
  from piccolo.query.methods.refresh import Refresh
51
51
  from piccolo.querystring import QueryString
52
52
  from piccolo.utils import _camel_to_snake
@@ -612,14 +612,14 @@ class Table(metaclass=TableMetaclass):
612
612
  @t.overload
613
613
  def get_related(
614
614
  self, foreign_key: ForeignKey[ReferencedTable]
615
- ) -> First[ReferencedTable]: ...
615
+ ) -> GetRelated[ReferencedTable]: ...
616
616
 
617
617
  @t.overload
618
- def get_related(self, foreign_key: str) -> First[Table]: ...
618
+ def get_related(self, foreign_key: str) -> GetRelated[Table]: ...
619
619
 
620
620
  def get_related(
621
621
  self, foreign_key: t.Union[str, ForeignKey[ReferencedTable]]
622
- ) -> t.Union[First[Table], First[ReferencedTable]]:
622
+ ) -> GetRelated[ReferencedTable]:
623
623
  """
624
624
  Used to fetch a ``Table`` instance, for the target of a foreign key.
625
625
 
@@ -630,8 +630,8 @@ class Table(metaclass=TableMetaclass):
630
630
  >>> print(manager.name)
631
631
  'Guido'
632
632
 
633
- It can only follow foreign keys one level currently.
634
- i.e. ``Band.manager``, but not ``Band.manager.x.y.z``.
633
+ It can only follow foreign keys multiple levels deep. For example,
634
+ ``Concert.band_1.manager``.
635
635
 
636
636
  """
637
637
  if isinstance(foreign_key, str):
@@ -645,18 +645,7 @@ class Table(metaclass=TableMetaclass):
645
645
  "ForeignKey column."
646
646
  )
647
647
 
648
- column_name = foreign_key._meta.name
649
-
650
- references = foreign_key._foreign_key_meta.resolved_references
651
-
652
- return (
653
- references.objects()
654
- .where(
655
- foreign_key._foreign_key_meta.resolved_target_column
656
- == getattr(self, column_name)
657
- )
658
- .first()
659
- )
648
+ return GetRelated(foreign_key=foreign_key, row=self)
660
649
 
661
650
  def get_m2m(self, m2m: M2M) -> M2MGetRelated:
662
651
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 1.19.0
3
+ Version: 1.20.0
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
@@ -434,6 +434,22 @@ class M2MBase:
434
434
 
435
435
  self.assertEqual([i.name for i in genres], ["Rock", "Folk"])
436
436
 
437
+ def test_get_m2m_no_rows(self):
438
+ """
439
+ If there are no matching objects, then an empty list should be
440
+ returned.
441
+
442
+ https://github.com/piccolo-orm/piccolo/issues/1090
443
+
444
+ """
445
+ band = Band.objects().get(Band.name == "Pythonistas").run_sync()
446
+ assert band is not None
447
+
448
+ Genre.delete(force=True).run_sync()
449
+
450
+ genres = band.get_m2m(Band.genres).run_sync()
451
+ self.assertEqual(genres, [])
452
+
437
453
  def test_remove_m2m(self):
438
454
  """
439
455
  Make sure we can remove related items via the joining table.
@@ -0,0 +1,98 @@
1
+ import typing as t
2
+
3
+ from piccolo.testing.test_case import AsyncTableTest
4
+ from tests.example_apps.music.tables import Band, Concert, Manager, Venue
5
+
6
+
7
+ class TestGetRelated(AsyncTableTest):
8
+ tables = [Manager, Band, Concert, Venue]
9
+
10
+ async def asyncSetUp(self):
11
+ await super().asyncSetUp()
12
+
13
+ # Setup two pairs of manager/band, so we can make sure the correct
14
+ # objects are returned.
15
+
16
+ self.manager = Manager(name="Guido")
17
+ await self.manager.save()
18
+
19
+ self.band = Band(
20
+ name="Pythonistas", manager=self.manager.id, popularity=100
21
+ )
22
+ await self.band.save()
23
+
24
+ self.manager_2 = Manager(name="Graydon")
25
+ await self.manager_2.save()
26
+
27
+ self.band_2 = Band(
28
+ name="Rustaceans", manager=self.manager_2.id, popularity=100
29
+ )
30
+ await self.band_2.save()
31
+
32
+ async def test_foreign_key(self) -> None:
33
+ """
34
+ Make sure you can get a related object from another object instance.
35
+ """
36
+ manager = await self.band.get_related(Band.manager)
37
+ assert manager is not None
38
+ self.assertTrue(manager.id == self.manager.id)
39
+
40
+ manager_2 = await self.band_2.get_related(Band.manager)
41
+ assert manager_2 is not None
42
+ self.assertTrue(manager_2.id == self.manager_2.id)
43
+
44
+ async def test_non_foreign_key(self):
45
+ """
46
+ Make sure that non-ForeignKey raise an exception.
47
+ """
48
+ with self.assertRaises(ValueError):
49
+ self.band.get_related(Band.name) # type: ignore
50
+
51
+ async def test_string(self):
52
+ """
53
+ Make sure it also works using a string representation of a foreign key.
54
+ """
55
+ manager = t.cast(Manager, await self.band.get_related("manager"))
56
+ self.assertTrue(manager.id == self.manager.id)
57
+
58
+ async def test_invalid_string(self):
59
+ """
60
+ Make sure an exception is raised if the foreign key string is invalid.
61
+ """
62
+ with self.assertRaises(ValueError):
63
+ self.band.get_related("abc123")
64
+
65
+ async def test_multiple_levels(self):
66
+ """
67
+ Make sure ``get_related`` works multiple levels deep.
68
+ """
69
+ concert = Concert(band_1=self.band, band_2=self.band_2)
70
+ await concert.save()
71
+
72
+ manager = await concert.get_related(Concert.band_1._.manager)
73
+ assert manager is not None
74
+ self.assertTrue(manager.id == self.manager.id)
75
+
76
+ manager_2 = await concert.get_related(Concert.band_2._.manager)
77
+ assert manager_2 is not None
78
+ self.assertTrue(manager_2.id == self.manager_2.id)
79
+
80
+ async def test_no_match(self):
81
+ """
82
+ If not related object exists, make sure ``None`` is returned.
83
+ """
84
+ concert = Concert(band_1=self.band, band_2=None)
85
+ await concert.save()
86
+
87
+ manager_2 = await concert.get_related(Concert.band_2._.manager)
88
+ assert manager_2 is None
89
+
90
+ async def test_not_in_db(self):
91
+ """
92
+ If the object we're calling ``get_related`` on doesn't exist in the
93
+ database, then make sure an error is raised.
94
+ """
95
+ concert = Concert(band_1=self.band, band_2=self.band_2)
96
+
97
+ with self.assertRaises(ValueError):
98
+ await concert.get_related(Concert.band_1._.manager)
@@ -1 +0,0 @@
1
- __VERSION__ = "1.19.0"
@@ -1,42 +0,0 @@
1
- import typing as t
2
- from unittest import TestCase
3
-
4
- from tests.example_apps.music.tables import Band, Manager
5
-
6
- TABLES = [Manager, Band]
7
-
8
-
9
- class TestGetRelated(TestCase):
10
- def setUp(self):
11
- for table in TABLES:
12
- table.create_table().run_sync()
13
-
14
- def tearDown(self):
15
- for table in reversed(TABLES):
16
- table.alter().drop_table().run_sync()
17
-
18
- def test_get_related(self) -> None:
19
- """
20
- Make sure you can get a related object from another object instance.
21
- """
22
- manager = Manager(name="Guido")
23
- manager.save().run_sync()
24
-
25
- band = Band(name="Pythonistas", manager=manager.id, popularity=100)
26
- band.save().run_sync()
27
-
28
- _manager = band.get_related(Band.manager).run_sync()
29
- assert _manager is not None
30
- self.assertTrue(_manager.name == "Guido")
31
-
32
- # Test non-ForeignKey
33
- with self.assertRaises(ValueError):
34
- band.get_related(Band.name) # type: ignore
35
-
36
- # Make sure it also works using a string
37
- _manager_2 = t.cast(Manager, band.get_related("manager").run_sync())
38
- self.assertTrue(_manager_2.name == "Guido")
39
-
40
- # Test an invalid string
41
- with self.assertRaises(ValueError):
42
- band.get_related("abc123")
File without changes
File without changes