piccolo 1.18.0__tar.gz → 1.19.1__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 (385) hide show
  1. {piccolo-1.18.0 → piccolo-1.19.1}/PKG-INFO +1 -1
  2. piccolo-1.19.1/piccolo/__init__.py +1 -0
  3. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/new.py +2 -2
  4. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja +9 -13
  5. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja +14 -24
  6. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/_lilya_app.py.jinja +6 -7
  7. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/_litestar_app.py.jinja +32 -11
  8. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/m2m.py +6 -2
  9. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/objects.py +25 -0
  10. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/select.py +34 -0
  11. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/mixins.py +88 -0
  12. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo.egg-info/PKG-INFO +1 -1
  13. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/m2m/base.py +16 -0
  14. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_select.py +34 -0
  15. piccolo-1.18.0/piccolo/__init__.py +0 -1
  16. {piccolo-1.18.0 → piccolo-1.19.1}/LICENSE +0 -0
  17. {piccolo-1.18.0 → piccolo-1.19.1}/README.md +0 -0
  18. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/__init__.py +0 -0
  19. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/app/__init__.py +0 -0
  20. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/app/commands/__init__.py +0 -0
  21. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/app/commands/new.py +0 -0
  22. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/app/commands/show_all.py +0 -0
  23. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/app/commands/templates/piccolo_app.py.jinja +0 -0
  24. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/app/commands/templates/tables.py.jinja +0 -0
  25. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/app/piccolo_app.py +0 -0
  26. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/__init__.py +0 -0
  27. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/__init__.py +0 -0
  28. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/README.md.jinja +0 -0
  29. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/_fastapi_app.py.jinja +0 -0
  30. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/_starlette_app.py.jinja +0 -0
  31. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/app.py.jinja +0 -0
  32. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/conftest.py.jinja +0 -0
  33. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/__init__.py.jinja +0 -0
  34. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/_blacksheep_endpoints.py.jinja +0 -0
  35. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/_esmerald_endpoints.py.jinja +0 -0
  36. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/_lilya_endpoints.py.jinja +0 -0
  37. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/_litestar_endpoints.py.jinja +0 -0
  38. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/_starlette_endpoints.py.jinja +0 -0
  39. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/endpoints.py.jinja +0 -0
  40. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/piccolo_app.py.jinja +0 -0
  41. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/piccolo_migrations/README.md +0 -0
  42. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/tables.py.jinja +0 -0
  43. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/templates/base.html.jinja_raw +0 -0
  44. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/home/templates/home.html.jinja_raw +0 -0
  45. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/main.py.jinja +0 -0
  46. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/piccolo_conf.py.jinja +0 -0
  47. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/piccolo_conf_test.py.jinja +0 -0
  48. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/requirements.txt.jinja +0 -0
  49. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/static/favicon.ico +0 -0
  50. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/commands/templates/app/static/main.css +0 -0
  51. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/asgi/piccolo_app.py +0 -0
  52. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/fixtures/__init__.py +0 -0
  53. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/fixtures/commands/__init__.py +0 -0
  54. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/fixtures/commands/dump.py +0 -0
  55. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/fixtures/commands/load.py +0 -0
  56. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/fixtures/commands/shared.py +0 -0
  57. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/fixtures/piccolo_app.py +0 -0
  58. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/meta/__init__.py +0 -0
  59. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/meta/commands/__init__.py +0 -0
  60. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/meta/commands/version.py +0 -0
  61. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/meta/piccolo_app.py +0 -0
  62. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/__init__.py +0 -0
  63. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/__init__.py +0 -0
  64. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/diffable_table.py +0 -0
  65. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/migration_manager.py +0 -0
  66. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/operations.py +0 -0
  67. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/schema_differ.py +0 -0
  68. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/schema_snapshot.py +0 -0
  69. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/serialisation.py +0 -0
  70. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/auto/serialisation_legacy.py +0 -0
  71. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/__init__.py +0 -0
  72. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/backwards.py +0 -0
  73. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/base.py +0 -0
  74. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/check.py +0 -0
  75. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/clean.py +0 -0
  76. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/forwards.py +0 -0
  77. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/new.py +0 -0
  78. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/commands/templates/migration.py.jinja +0 -0
  79. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/piccolo_app.py +0 -0
  80. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/migrations/tables.py +0 -0
  81. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/playground/__init__.py +0 -0
  82. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/playground/commands/__init__.py +0 -0
  83. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/playground/commands/run.py +0 -0
  84. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/playground/piccolo_app.py +0 -0
  85. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/project/__init__.py +0 -0
  86. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/project/commands/__init__.py +0 -0
  87. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/project/commands/new.py +0 -0
  88. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/project/commands/templates/piccolo_conf.py.jinja +0 -0
  89. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/project/piccolo_app.py +0 -0
  90. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/schema/__init__.py +0 -0
  91. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/schema/commands/__init__.py +0 -0
  92. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/schema/commands/exceptions.py +0 -0
  93. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/schema/commands/generate.py +0 -0
  94. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/schema/commands/graph.py +0 -0
  95. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/schema/commands/templates/graphviz.dot.jinja +0 -0
  96. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/schema/piccolo_app.py +0 -0
  97. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/shell/__init__.py +0 -0
  98. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/shell/commands/__init__.py +0 -0
  99. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/shell/commands/run.py +0 -0
  100. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/shell/piccolo_app.py +0 -0
  101. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/sql_shell/__init__.py +0 -0
  102. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/sql_shell/commands/__init__.py +0 -0
  103. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/sql_shell/commands/run.py +0 -0
  104. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/sql_shell/piccolo_app.py +0 -0
  105. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/tester/__init__.py +0 -0
  106. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/tester/commands/__init__.py +0 -0
  107. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/tester/commands/run.py +0 -0
  108. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/tester/piccolo_app.py +0 -0
  109. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/__init__.py +0 -0
  110. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/commands/__init__.py +0 -0
  111. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/commands/change_password.py +0 -0
  112. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/commands/change_permissions.py +0 -0
  113. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/commands/create.py +0 -0
  114. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/commands/list.py +0 -0
  115. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/piccolo_app.py +0 -0
  116. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/piccolo_migrations/2019-11-14T21-52-21.py +0 -0
  117. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/piccolo_migrations/2020-06-11T21-38-55.py +0 -0
  118. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/piccolo_migrations/2021-04-30T16-14-15.py +0 -0
  119. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/piccolo_migrations/__init__.py +0 -0
  120. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/apps/user/tables.py +0 -0
  121. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/__init__.py +0 -0
  122. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/base.py +0 -0
  123. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/choices.py +0 -0
  124. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/column_types.py +0 -0
  125. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/combination.py +0 -0
  126. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/__init__.py +0 -0
  127. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/base.py +0 -0
  128. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/date.py +0 -0
  129. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/interval.py +0 -0
  130. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/time.py +0 -0
  131. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/timestamp.py +0 -0
  132. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/timestamptz.py +0 -0
  133. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/defaults/uuid.py +0 -0
  134. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/indexes.py +0 -0
  135. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/operators/__init__.py +0 -0
  136. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/operators/base.py +0 -0
  137. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/operators/comparison.py +0 -0
  138. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/operators/math.py +0 -0
  139. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/operators/string.py +0 -0
  140. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/readable.py +0 -0
  141. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/columns/reference.py +0 -0
  142. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/conf/__init__.py +0 -0
  143. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/conf/apps.py +0 -0
  144. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/custom_types.py +0 -0
  145. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/engine/__init__.py +0 -0
  146. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/engine/base.py +0 -0
  147. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/engine/cockroach.py +0 -0
  148. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/engine/exceptions.py +0 -0
  149. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/engine/finder.py +0 -0
  150. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/engine/postgres.py +0 -0
  151. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/engine/sqlite.py +0 -0
  152. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/main.py +0 -0
  153. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/py.typed +0 -0
  154. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/__init__.py +0 -0
  155. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/base.py +0 -0
  156. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/functions/__init__.py +0 -0
  157. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/functions/aggregate.py +0 -0
  158. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/functions/base.py +0 -0
  159. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/functions/datetime.py +0 -0
  160. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/functions/math.py +0 -0
  161. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/functions/string.py +0 -0
  162. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/functions/type_conversion.py +0 -0
  163. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/__init__.py +0 -0
  164. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/alter.py +0 -0
  165. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/count.py +0 -0
  166. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/create.py +0 -0
  167. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/create_index.py +0 -0
  168. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/delete.py +0 -0
  169. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/drop_index.py +0 -0
  170. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/exists.py +0 -0
  171. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/indexes.py +0 -0
  172. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/insert.py +0 -0
  173. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/raw.py +0 -0
  174. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/refresh.py +0 -0
  175. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/table_exists.py +0 -0
  176. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/methods/update.py +0 -0
  177. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/query/proxy.py +0 -0
  178. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/querystring.py +0 -0
  179. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/schema.py +0 -0
  180. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/table.py +0 -0
  181. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/table_reflection.py +0 -0
  182. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/testing/__init__.py +0 -0
  183. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/testing/model_builder.py +0 -0
  184. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/testing/random_builder.py +0 -0
  185. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/testing/test_case.py +0 -0
  186. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/__init__.py +0 -0
  187. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/dictionary.py +0 -0
  188. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/encoding.py +0 -0
  189. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/graphlib/__init__.py +0 -0
  190. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/graphlib/_graphlib.py +0 -0
  191. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/lazy_loader.py +0 -0
  192. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/list.py +0 -0
  193. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/naming.py +0 -0
  194. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/objects.py +0 -0
  195. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/printing.py +0 -0
  196. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/pydantic.py +0 -0
  197. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/repr.py +0 -0
  198. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/sql_values.py +0 -0
  199. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/sync.py +0 -0
  200. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo/utils/warnings.py +0 -0
  201. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo.egg-info/SOURCES.txt +0 -0
  202. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo.egg-info/dependency_links.txt +0 -0
  203. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo.egg-info/entry_points.txt +0 -0
  204. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo.egg-info/requires.txt +0 -0
  205. {piccolo-1.18.0 → piccolo-1.19.1}/piccolo.egg-info/top_level.txt +0 -0
  206. {piccolo-1.18.0 → piccolo-1.19.1}/profiling/__init__.py +0 -0
  207. {piccolo-1.18.0 → piccolo-1.19.1}/profiling/run_profile.py +0 -0
  208. {piccolo-1.18.0 → piccolo-1.19.1}/pyproject.toml +0 -0
  209. {piccolo-1.18.0 → piccolo-1.19.1}/setup.cfg +0 -0
  210. {piccolo-1.18.0 → piccolo-1.19.1}/setup.py +0 -0
  211. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/__init__.py +0 -0
  212. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/app/__init__.py +0 -0
  213. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/app/commands/__init__.py +0 -0
  214. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/app/commands/test_new.py +0 -0
  215. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/app/commands/test_show_all.py +0 -0
  216. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/asgi/__init__.py +0 -0
  217. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/asgi/commands/__init__.py +0 -0
  218. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/asgi/commands/test_new.py +0 -0
  219. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/fixtures/__init__.py +0 -0
  220. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/fixtures/commands/__init__.py +0 -0
  221. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/fixtures/commands/test_dump_load.py +0 -0
  222. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/fixtures/commands/test_shared.py +0 -0
  223. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/meta/__init__.py +0 -0
  224. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/meta/commands/__init__.py +0 -0
  225. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/meta/commands/test_version.py +0 -0
  226. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/__init__.py +0 -0
  227. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/__init__.py +0 -0
  228. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/integration/__init__.py +0 -0
  229. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/integration/test_migrations.py +0 -0
  230. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/test_diffable_table.py +0 -0
  231. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/test_migration_manager.py +0 -0
  232. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/test_schema_differ.py +0 -0
  233. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/test_schema_snapshot.py +0 -0
  234. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/auto/test_serialisation.py +0 -0
  235. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/__init__.py +0 -0
  236. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/test_base.py +0 -0
  237. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/test_check.py +0 -0
  238. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/test_clean.py +0 -0
  239. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/test_forwards_backwards.py +0 -0
  240. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/test_migrations/2020-03-31T20-38-22.py +0 -0
  241. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/test_migrations/__init__.py +0 -0
  242. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/commands/test_new.py +0 -0
  243. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/migrations/test_migration.py +0 -0
  244. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/project/__init__.py +0 -0
  245. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/project/commands/__init__.py +0 -0
  246. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/project/commands/test_new.py +0 -0
  247. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/schema/__init__.py +0 -0
  248. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/shell/__init__.py +0 -0
  249. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/shell/commands/__init__.py +0 -0
  250. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/shell/commands/test_run.py +0 -0
  251. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/sql_shell/__init__.py +0 -0
  252. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/sql_shell/commands/__init__.py +0 -0
  253. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/sql_shell/commands/test_run.py +0 -0
  254. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/tester/__init__.py +0 -0
  255. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/user/__init__.py +0 -0
  256. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/user/commands/__init__.py +0 -0
  257. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/user/commands/test_change_password.py +0 -0
  258. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/user/commands/test_change_permissions.py +0 -0
  259. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/user/commands/test_create.py +0 -0
  260. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/user/commands/test_list.py +0 -0
  261. {piccolo-1.18.0 → piccolo-1.19.1}/tests/apps/user/test_tables.py +0 -0
  262. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/__init__.py +0 -0
  263. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/m2m/__init__.py +0 -0
  264. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/m2m/test_m2m.py +0 -0
  265. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/m2m/test_m2m_schema.py +0 -0
  266. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_array.py +0 -0
  267. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_base.py +0 -0
  268. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_bigint.py +0 -0
  269. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_boolean.py +0 -0
  270. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_bytea.py +0 -0
  271. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_choices.py +0 -0
  272. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_combination.py +0 -0
  273. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_date.py +0 -0
  274. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_db_column_name.py +0 -0
  275. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_defaults.py +0 -0
  276. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_double_precision.py +0 -0
  277. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_get_sql_value.py +0 -0
  278. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_interval.py +0 -0
  279. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_json.py +0 -0
  280. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_jsonb.py +0 -0
  281. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_numeric.py +0 -0
  282. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_primary_key.py +0 -0
  283. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_readable.py +0 -0
  284. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_real.py +0 -0
  285. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_reference.py +0 -0
  286. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_reserved_column_names.py +0 -0
  287. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_smallint.py +0 -0
  288. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_time.py +0 -0
  289. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_timestamp.py +0 -0
  290. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_timestamptz.py +0 -0
  291. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_uuid.py +0 -0
  292. {piccolo-1.18.0 → piccolo-1.19.1}/tests/columns/test_varchar.py +0 -0
  293. {piccolo-1.18.0 → piccolo-1.19.1}/tests/conf/__init__.py +0 -0
  294. {piccolo-1.18.0 → piccolo-1.19.1}/tests/conf/example.py +0 -0
  295. {piccolo-1.18.0 → piccolo-1.19.1}/tests/conf/test_apps.py +0 -0
  296. {piccolo-1.18.0 → piccolo-1.19.1}/tests/engine/__init__.py +0 -0
  297. {piccolo-1.18.0 → piccolo-1.19.1}/tests/engine/test_extra_nodes.py +0 -0
  298. {piccolo-1.18.0 → piccolo-1.19.1}/tests/engine/test_logging.py +0 -0
  299. {piccolo-1.18.0 → piccolo-1.19.1}/tests/engine/test_nested_transaction.py +0 -0
  300. {piccolo-1.18.0 → piccolo-1.19.1}/tests/engine/test_pool.py +0 -0
  301. {piccolo-1.18.0 → piccolo-1.19.1}/tests/engine/test_transaction.py +0 -0
  302. {piccolo-1.18.0 → piccolo-1.19.1}/tests/engine/test_version_parsing.py +0 -0
  303. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/__init__.py +0 -0
  304. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/mega/__init__.py +0 -0
  305. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/mega/piccolo_app.py +0 -0
  306. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/mega/piccolo_migrations/2021-09-20T21-23-25-698988.py +0 -0
  307. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/mega/piccolo_migrations/__init__.py +0 -0
  308. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/mega/tables.py +0 -0
  309. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/music/__init__.py +0 -0
  310. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/music/piccolo_app.py +0 -0
  311. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/music/tables.py +0 -0
  312. {piccolo-1.18.0 → piccolo-1.19.1}/tests/example_apps/music/tables_detailed.py +0 -0
  313. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/__init__.py +0 -0
  314. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/functions/__init__.py +0 -0
  315. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/functions/base.py +0 -0
  316. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/functions/test_datetime.py +0 -0
  317. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/functions/test_functions.py +0 -0
  318. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/functions/test_math.py +0 -0
  319. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/functions/test_string.py +0 -0
  320. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/functions/test_type_conversion.py +0 -0
  321. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/mixins/__init__.py +0 -0
  322. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/mixins/test_columns_delegate.py +0 -0
  323. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/mixins/test_order_by_delegate.py +0 -0
  324. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/test_await.py +0 -0
  325. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/test_camelcase.py +0 -0
  326. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/test_freeze.py +0 -0
  327. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/test_gather.py +0 -0
  328. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/test_querystring.py +0 -0
  329. {piccolo-1.18.0 → piccolo-1.19.1}/tests/query/test_slots.py +0 -0
  330. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/__init__.py +0 -0
  331. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/__init__.py +0 -0
  332. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/test_create.py +0 -0
  333. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/test_get_related.py +0 -0
  334. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/test_get_related_readable.py +0 -0
  335. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/test_instantiate.py +0 -0
  336. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/test_remove.py +0 -0
  337. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/test_save.py +0 -0
  338. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/instance/test_to_dict.py +0 -0
  339. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_all_columns.py +0 -0
  340. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_alter.py +0 -0
  341. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_batch.py +0 -0
  342. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_callback.py +0 -0
  343. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_constructor.py +0 -0
  344. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_count.py +0 -0
  345. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_create.py +0 -0
  346. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_create_db_tables.py +0 -0
  347. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_create_table_class.py +0 -0
  348. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_delete.py +0 -0
  349. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_drop_db_tables.py +0 -0
  350. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_exists.py +0 -0
  351. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_from_dict.py +0 -0
  352. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_indexes.py +0 -0
  353. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_inheritance.py +0 -0
  354. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_insert.py +0 -0
  355. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_join.py +0 -0
  356. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_join_on.py +0 -0
  357. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_metaclass.py +0 -0
  358. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_objects.py +0 -0
  359. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_output.py +0 -0
  360. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_raw.py +0 -0
  361. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_ref.py +0 -0
  362. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_refresh.py +0 -0
  363. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_repr.py +0 -0
  364. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_str.py +0 -0
  365. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_table_exists.py +0 -0
  366. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_update.py +0 -0
  367. {piccolo-1.18.0 → piccolo-1.19.1}/tests/table/test_update_self.py +0 -0
  368. {piccolo-1.18.0 → piccolo-1.19.1}/tests/test_main.py +0 -0
  369. {piccolo-1.18.0 → piccolo-1.19.1}/tests/test_schema.py +0 -0
  370. {piccolo-1.18.0 → piccolo-1.19.1}/tests/testing/__init__.py +0 -0
  371. {piccolo-1.18.0 → piccolo-1.19.1}/tests/testing/test_model_builder.py +0 -0
  372. {piccolo-1.18.0 → piccolo-1.19.1}/tests/testing/test_random_builder.py +0 -0
  373. {piccolo-1.18.0 → piccolo-1.19.1}/tests/testing/test_test_case.py +0 -0
  374. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/__init__.py +0 -0
  375. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_dictionary.py +0 -0
  376. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_encoding.py +0 -0
  377. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_lazy_loader.py +0 -0
  378. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_list.py +0 -0
  379. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_naming.py +0 -0
  380. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_printing.py +0 -0
  381. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_pydantic.py +0 -0
  382. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_sql_values.py +0 -0
  383. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_sync.py +0 -0
  384. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_table_reflection.py +0 -0
  385. {piccolo-1.18.0 → piccolo-1.19.1}/tests/utils/test_warnings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 1.18.0
3
+ Version: 1.19.1
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.19.1"
@@ -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
@@ -13,6 +13,8 @@ from piccolo.query.mixins import (
13
13
  CallbackDelegate,
14
14
  CallbackType,
15
15
  LimitDelegate,
16
+ LockRowsDelegate,
17
+ LockStrength,
16
18
  OffsetDelegate,
17
19
  OrderByDelegate,
18
20
  OrderByRaw,
@@ -250,6 +252,7 @@ class Objects(
250
252
  "callback_delegate",
251
253
  "prefetch_delegate",
252
254
  "where_delegate",
255
+ "lock_rows_delegate",
253
256
  )
254
257
 
255
258
  def __init__(
@@ -269,6 +272,7 @@ class Objects(
269
272
  self.prefetch_delegate = PrefetchDelegate()
270
273
  self.prefetch(*prefetch)
271
274
  self.where_delegate = WhereDelegate()
275
+ self.lock_rows_delegate = LockRowsDelegate()
272
276
 
273
277
  def output(self: Self, load_json: bool = False) -> Self:
274
278
  self.output_delegate.output(
@@ -328,6 +332,26 @@ class Objects(
328
332
  self.limit_delegate.limit(1)
329
333
  return First[TableInstance](query=self)
330
334
 
335
+ def lock_rows(
336
+ self: Self,
337
+ lock_strength: t.Union[
338
+ LockStrength,
339
+ t.Literal[
340
+ "UPDATE",
341
+ "NO KEY UPDATE",
342
+ "KEY SHARE",
343
+ "SHARE",
344
+ ],
345
+ ] = LockStrength.update,
346
+ nowait: bool = False,
347
+ skip_locked: bool = False,
348
+ of: t.Tuple[type[Table], ...] = (),
349
+ ) -> Self:
350
+ self.lock_rows_delegate.lock_rows(
351
+ lock_strength, nowait, skip_locked, of
352
+ )
353
+ return self
354
+
331
355
  def get(self, where: Combinable) -> Get[TableInstance]:
332
356
  self.where_delegate.where(where)
333
357
  self.limit_delegate.limit(1)
@@ -378,6 +402,7 @@ class Objects(
378
402
  "offset_delegate",
379
403
  "output_delegate",
380
404
  "order_by_delegate",
405
+ "lock_rows_delegate",
381
406
  ):
382
407
  setattr(select, attr, getattr(self, attr))
383
408
 
@@ -19,6 +19,8 @@ from piccolo.query.mixins import (
19
19
  DistinctDelegate,
20
20
  GroupByDelegate,
21
21
  LimitDelegate,
22
+ LockRowsDelegate,
23
+ LockStrength,
22
24
  OffsetDelegate,
23
25
  OrderByDelegate,
24
26
  OrderByRaw,
@@ -150,6 +152,7 @@ class Select(Query[TableInstance, t.List[t.Dict[str, t.Any]]]):
150
152
  "output_delegate",
151
153
  "callback_delegate",
152
154
  "where_delegate",
155
+ "lock_rows_delegate",
153
156
  )
154
157
 
155
158
  def __init__(
@@ -174,6 +177,7 @@ class Select(Query[TableInstance, t.List[t.Dict[str, t.Any]]]):
174
177
  self.output_delegate = OutputDelegate()
175
178
  self.callback_delegate = CallbackDelegate()
176
179
  self.where_delegate = WhereDelegate()
180
+ self.lock_rows_delegate = LockRowsDelegate()
177
181
 
178
182
  self.columns(*columns_list)
179
183
 
@@ -219,6 +223,26 @@ class Select(Query[TableInstance, t.List[t.Dict[str, t.Any]]]):
219
223
  self.offset_delegate.offset(number)
220
224
  return self
221
225
 
226
+ def lock_rows(
227
+ self: Self,
228
+ lock_strength: t.Union[
229
+ LockStrength,
230
+ t.Literal[
231
+ "UPDATE",
232
+ "NO KEY UPDATE",
233
+ "KEY SHARE",
234
+ "SHARE",
235
+ ],
236
+ ] = LockStrength.update,
237
+ nowait: bool = False,
238
+ skip_locked: bool = False,
239
+ of: t.Tuple[type[Table], ...] = (),
240
+ ) -> Self:
241
+ self.lock_rows_delegate.lock_rows(
242
+ lock_strength, nowait, skip_locked, of
243
+ )
244
+ return self
245
+
222
246
  async def _splice_m2m_rows(
223
247
  self,
224
248
  response: t.List[t.Dict[str, t.Any]],
@@ -618,6 +642,16 @@ class Select(Query[TableInstance, t.List[t.Dict[str, t.Any]]]):
618
642
  query += "{}"
619
643
  args.append(self.offset_delegate._offset.querystring)
620
644
 
645
+ if self.lock_rows_delegate._lock_rows:
646
+ if engine_type == "sqlite":
647
+ raise NotImplementedError(
648
+ "SQLite doesn't support row locking e.g. SELECT ... FOR "
649
+ "UPDATE"
650
+ )
651
+
652
+ query += "{}"
653
+ args.append(self.lock_rows_delegate._lock_rows.querystring)
654
+
621
655
  querystring = QueryString(query, *args)
622
656
 
623
657
  return [querystring]
@@ -784,3 +784,91 @@ class OnConflictDelegate:
784
784
  target=target, action=action_, values=values, where=where
785
785
  )
786
786
  )
787
+
788
+
789
+ class LockStrength(str, Enum):
790
+ """
791
+ Specify lock strength
792
+
793
+ https://www.postgresql.org/docs/current/sql-select.html#SQL-FOR-UPDATE-SHARE
794
+ """
795
+
796
+ update = "UPDATE"
797
+ no_key_update = "NO KEY UPDATE"
798
+ share = "SHARE"
799
+ key_share = "KEY SHARE"
800
+
801
+
802
+ @dataclass
803
+ class LockRows:
804
+ __slots__ = ("lock_strength", "nowait", "skip_locked", "of")
805
+
806
+ lock_strength: LockStrength
807
+ nowait: bool
808
+ skip_locked: bool
809
+ of: t.Tuple[t.Type[Table], ...]
810
+
811
+ def __post_init__(self):
812
+ if not isinstance(self.lock_strength, LockStrength):
813
+ raise TypeError("lock_strength must be a LockStrength")
814
+ if not isinstance(self.nowait, bool):
815
+ raise TypeError("nowait must be a bool")
816
+ if not isinstance(self.skip_locked, bool):
817
+ raise TypeError("skip_locked must be a bool")
818
+ if not isinstance(self.of, tuple) or not all(
819
+ hasattr(x, "_meta") for x in self.of
820
+ ):
821
+ raise TypeError("of must be a tuple of Table")
822
+ if self.nowait and self.skip_locked:
823
+ raise TypeError(
824
+ "The nowait option cannot be used with skip_locked"
825
+ )
826
+
827
+ @property
828
+ def querystring(self) -> QueryString:
829
+ sql = f" FOR {self.lock_strength.value}"
830
+ if self.of:
831
+ tables = ", ".join(
832
+ i._meta.get_formatted_tablename() for i in self.of
833
+ )
834
+ sql += " OF " + tables
835
+ if self.nowait:
836
+ sql += " NOWAIT"
837
+ if self.skip_locked:
838
+ sql += " SKIP LOCKED"
839
+
840
+ return QueryString(sql)
841
+
842
+ def __str__(self) -> str:
843
+ return self.querystring.__str__()
844
+
845
+
846
+ @dataclass
847
+ class LockRowsDelegate:
848
+
849
+ _lock_rows: t.Optional[LockRows] = None
850
+
851
+ def lock_rows(
852
+ self,
853
+ lock_strength: t.Union[
854
+ LockStrength,
855
+ t.Literal[
856
+ "UPDATE",
857
+ "NO KEY UPDATE",
858
+ "KEY SHARE",
859
+ "SHARE",
860
+ ],
861
+ ] = LockStrength.update,
862
+ nowait=False,
863
+ skip_locked=False,
864
+ of: t.Tuple[type[Table], ...] = (),
865
+ ):
866
+ lock_strength_: LockStrength
867
+ if isinstance(lock_strength, LockStrength):
868
+ lock_strength_ = lock_strength
869
+ elif isinstance(lock_strength, str):
870
+ lock_strength_ = LockStrength(lock_strength.upper())
871
+ else:
872
+ raise ValueError("Unrecognised `lock_strength` value.")
873
+
874
+ self._lock_rows = LockRows(lock_strength_, nowait, skip_locked, of)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: piccolo
3
- Version: 1.18.0
3
+ Version: 1.19.1
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.
@@ -1028,6 +1028,40 @@ class TestSelect(DBTestCase):
1028
1028
  response, [{"name": "Pythonistas", "popularity_log": 3.0}]
1029
1029
  )
1030
1030
 
1031
+ @pytest.mark.skipif(
1032
+ is_running_sqlite(),
1033
+ reason="SQLite doesn't support SELECT ... FOR UPDATE.",
1034
+ )
1035
+ def test_lock_rows(self):
1036
+ """
1037
+ Make sure the for_update clause works.
1038
+ """
1039
+ self.insert_rows()
1040
+
1041
+ query = Band.select()
1042
+ self.assertNotIn("FOR UPDATE", query.__str__())
1043
+
1044
+ query = query.lock_rows()
1045
+ self.assertTrue(query.__str__().endswith("FOR UPDATE"))
1046
+
1047
+ query = query.lock_rows(lock_strength="KEY SHARE")
1048
+ self.assertTrue(query.__str__().endswith("FOR KEY SHARE"))
1049
+
1050
+ query = query.lock_rows(skip_locked=True)
1051
+ self.assertTrue(query.__str__().endswith("FOR UPDATE SKIP LOCKED"))
1052
+
1053
+ query = query.lock_rows(nowait=True)
1054
+ self.assertTrue(query.__str__().endswith("FOR UPDATE NOWAIT"))
1055
+
1056
+ query = query.lock_rows(of=(Band,))
1057
+ self.assertTrue(query.__str__().endswith('FOR UPDATE OF "band"'))
1058
+
1059
+ with self.assertRaises(TypeError):
1060
+ query = query.lock_rows(skip_locked=True, nowait=True)
1061
+
1062
+ response = query.run_sync()
1063
+ assert response is not None
1064
+
1031
1065
 
1032
1066
  class TestSelectSecret(TestCase):
1033
1067
  def setUp(self):
@@ -1 +0,0 @@
1
- __VERSION__ = "1.18.0"
File without changes
File without changes