diff --git a/examples/basic.py b/examples/basic.py index 9ef1c9ba7..16b4718f8 100644 --- a/examples/basic.py +++ b/examples/basic.py @@ -1,6 +1,7 @@ """ This example demonstrates most basic operations with single model """ + from tortoise import Tortoise, fields, run_async from tortoise.models import Model diff --git a/examples/basic_comments.py b/examples/basic_comments.py index a7107a9f8..2fe68ab8b 100644 --- a/examples/basic_comments.py +++ b/examples/basic_comments.py @@ -2,6 +2,7 @@ This example demonstrates most basic operations with single model and a Table definition generation with comment support """ + from tortoise import Tortoise, fields, run_async from tortoise.models import Model diff --git a/examples/complex_filtering.py b/examples/complex_filtering.py index 45c67cd47..f3bf9876e 100644 --- a/examples/complex_filtering.py +++ b/examples/complex_filtering.py @@ -3,6 +3,7 @@ Key points are filtering by related names and using Q objects """ + from tortoise import Tortoise, fields, run_async from tortoise.expressions import Q from tortoise.models import Model diff --git a/examples/manual_sql.py b/examples/manual_sql.py index b3d46e036..5c58785a3 100644 --- a/examples/manual_sql.py +++ b/examples/manual_sql.py @@ -1,6 +1,7 @@ """ This example demonstrates executing manual SQL queries """ + from tortoise import Tortoise, connections, fields, run_async from tortoise.models import Model from tortoise.transactions import in_transaction diff --git a/examples/postgres.py b/examples/postgres.py index d557f556f..429863856 100644 --- a/examples/postgres.py +++ b/examples/postgres.py @@ -1,6 +1,7 @@ """ This example showcases postgres features """ + from tortoise import Tortoise, fields, run_async from tortoise.models import Model diff --git a/examples/pydantic/basic.py b/examples/pydantic/basic.py index 456188810..e684a930c 100644 --- a/examples/pydantic/basic.py +++ b/examples/pydantic/basic.py @@ -1,6 +1,7 @@ """ This example demonstrates pydantic serialisation """ + from tortoise import Tortoise, fields, run_async from tortoise.contrib.pydantic import pydantic_model_creator, pydantic_queryset_creator from tortoise.models import Model @@ -60,7 +61,6 @@ class Meta: async def run(): await Tortoise.init(db_url="sqlite://:memory:", modules={"models": ["__main__"]}) await Tortoise.generate_schemas() - Event_Pydantic = pydantic_model_creator(Event) Event_Pydantic_List = pydantic_queryset_creator(Event) Tournament_Pydantic = pydantic_model_creator(Tournament) diff --git a/examples/pydantic/early_init.py b/examples/pydantic/early_init.py index 1f84de17a..192290bcc 100644 --- a/examples/pydantic/early_init.py +++ b/examples/pydantic/early_init.py @@ -1,6 +1,7 @@ """ This example demonstrates pydantic serialisation, and how to use early partial init. """ + from tortoise import Tortoise, fields from tortoise.contrib.pydantic import pydantic_model_creator from tortoise.models import Model diff --git a/examples/pydantic/recursive.py b/examples/pydantic/recursive.py index 796d7cf18..a748a216f 100644 --- a/examples/pydantic/recursive.py +++ b/examples/pydantic/recursive.py @@ -1,6 +1,7 @@ """ This example demonstrates pydantic serialisation of a recursively cycled model. """ + from tortoise import Tortoise, fields, run_async from tortoise.contrib.pydantic import pydantic_model_creator from tortoise.exceptions import NoValuesFetched diff --git a/examples/pydantic/tutorial_1.py b/examples/pydantic/tutorial_1.py index 093577920..fd8093e7d 100644 --- a/examples/pydantic/tutorial_1.py +++ b/examples/pydantic/tutorial_1.py @@ -7,6 +7,7 @@ * Evaluating the generated schema * Simple serialisation with both .model_dump() and .model_dump_json() """ + from tortoise import Tortoise, fields, run_async from tortoise.contrib.pydantic import pydantic_model_creator from tortoise.models import Model diff --git a/examples/pydantic/tutorial_2.py b/examples/pydantic/tutorial_2.py index e87f943a2..c6dbd028f 100644 --- a/examples/pydantic/tutorial_2.py +++ b/examples/pydantic/tutorial_2.py @@ -5,6 +5,7 @@ * Creating a list-model to serialise a queryset * Default sorting is honoured """ + from tortoise import Tortoise, fields, run_async from tortoise.contrib.pydantic import pydantic_queryset_creator from tortoise.models import Model diff --git a/examples/pydantic/tutorial_3.py b/examples/pydantic/tutorial_3.py index 7a7cbfa4f..3915df505 100644 --- a/examples/pydantic/tutorial_3.py +++ b/examples/pydantic/tutorial_3.py @@ -5,6 +5,7 @@ * Relationships * Early model init """ + from tortoise import Tortoise, fields, run_async from tortoise.contrib.pydantic import pydantic_model_creator from tortoise.models import Model diff --git a/examples/pydantic/tutorial_4.py b/examples/pydantic/tutorial_4.py index accf615cf..33cd91270 100644 --- a/examples/pydantic/tutorial_4.py +++ b/examples/pydantic/tutorial_4.py @@ -5,6 +5,7 @@ * Configuring model creator via PydanticMeta class. * Using callable functions to annotate extra data. """ + from tortoise import Tortoise, fields, run_async from tortoise.contrib.pydantic import pydantic_model_creator from tortoise.exceptions import NoValuesFetched diff --git a/examples/relations.py b/examples/relations.py index 1c80975cf..744bad7f6 100644 --- a/examples/relations.py +++ b/examples/relations.py @@ -5,6 +5,7 @@ to declare relations and use of .prefetch_related() and .fetch_related() to get this related objects """ + from tortoise import Tortoise, fields, run_async from tortoise.exceptions import NoValuesFetched from tortoise.models import Model diff --git a/examples/relations_recursive.py b/examples/relations_recursive.py index a2648d30a..7a34f04ca 100644 --- a/examples/relations_recursive.py +++ b/examples/relations_recursive.py @@ -8,6 +8,7 @@ * To use .fetch_related(…) to emulate sync behaviour * That insert-order gets preserved for ForeignFields, but not ManyToManyFields """ + from tortoise import Tortoise, fields, run_async from tortoise.models import Model diff --git a/examples/relations_with_unique.py b/examples/relations_with_unique.py index 9744bf54a..baa4be05c 100644 --- a/examples/relations_with_unique.py +++ b/examples/relations_with_unique.py @@ -4,6 +4,7 @@ Key points in this example are use of ForeignKeyField and OneToOneField has to_field. For other basic parts, it is the same as relation example. """ + from tortoise import Tortoise, fields, run_async from tortoise.models import Model from tortoise.query_utils import Prefetch diff --git a/examples/router.py b/examples/router.py index 951971cb0..3e162ac35 100644 --- a/examples/router.py +++ b/examples/router.py @@ -1,6 +1,7 @@ """ This example to use router to implement read/write separation """ + from typing import Type from tortoise import Tortoise, fields, run_async diff --git a/examples/schema_create.py b/examples/schema_create.py index 4dcb47687..6fc0362f4 100644 --- a/examples/schema_create.py +++ b/examples/schema_create.py @@ -1,6 +1,7 @@ """ This example demonstrates SQL Schema generation for each DB type supported. """ + from tortoise import Tortoise, connections, fields, run_async from tortoise.models import Model from tortoise.utils import get_schema_sql diff --git a/examples/signals.py b/examples/signals.py index 8ac06ae0e..6a0210d70 100644 --- a/examples/signals.py +++ b/examples/signals.py @@ -1,6 +1,7 @@ """ This example demonstrates model signals usage """ + from typing import List, Optional, Type from tortoise import BaseDBAsyncClient, Tortoise, fields, run_async diff --git a/examples/transactions.py b/examples/transactions.py index 01777b244..88af34d56 100644 --- a/examples/transactions.py +++ b/examples/transactions.py @@ -1,6 +1,7 @@ """ This example demonstrates how you can use transactions with tortoise """ + from tortoise import Tortoise, fields, run_async from tortoise.exceptions import OperationalError from tortoise.models import Model diff --git a/examples/two_databases.py b/examples/two_databases.py index 96d59d68b..e91df2d8f 100644 --- a/examples/two_databases.py +++ b/examples/two_databases.py @@ -8,6 +8,7 @@ Key notes of this example is using db_route for Tortoise init and explicitly declaring model apps in class Meta """ + from tortoise import Tortoise, connections, fields, run_async from tortoise.exceptions import OperationalError from tortoise.models import Model diff --git a/poetry.lock b/poetry.lock index b6f650904..058946e4a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiofiles" @@ -522,39 +522,43 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "blacksheep" -version = "1.2.20" +version = "2.0.7" description = "Fast web framework for Python asyncio" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "blacksheep-1.2.20-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:fa57abe3ded9dca778659d5523aeecec75531fa74322cd7f5ae8de316c4a5aaa"}, - {file = "blacksheep-1.2.20-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:188fb88b2c7a260d72d2965a02692debc3caf67b3bc167a98e232d0bd36baaae"}, - {file = "blacksheep-1.2.20-cp310-cp310-win_amd64.whl", hash = "sha256:bbe28efbfa4a496618af790cb4947aab834da577cb5cccecd4ea8d22f4047aeb"}, - {file = "blacksheep-1.2.20-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:e302efc88f2fc592fd202e99f83b2614384943a525f8cd6a3a5cc564e71cdf78"}, - {file = "blacksheep-1.2.20-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17bcf4fddd17768a45cacf3d88919fc81baa5ffc8811733052456c683d8225b4"}, - {file = "blacksheep-1.2.20-cp311-cp311-win_amd64.whl", hash = "sha256:9bf5e8249b7d94adc053a76e5ce43036fb3f725e0934f18ff5c00127efb46329"}, - {file = "blacksheep-1.2.20-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:e38a4a800a866d8fa00041431886730fe4de6958bbc9984bf401b7ec41c41f89"}, - {file = "blacksheep-1.2.20-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fddc73f1c14782862f010baa3bbe66c21d9a36e50e919a2d785cf0435b187e7c"}, - {file = "blacksheep-1.2.20-cp38-cp38-win_amd64.whl", hash = "sha256:d7954ab44ded25e91afdac06e28ec800f9e9f83a09555564666023eec6231c5b"}, - {file = "blacksheep-1.2.20-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:8d027da05118e75872809b9492b793f64f83365dfe472fbdbed2fe4a8607222e"}, - {file = "blacksheep-1.2.20-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53bc843c1e07f527a44b9edfdf6cb8496730308b9a15d4212c10051bfae3fe97"}, - {file = "blacksheep-1.2.20-cp39-cp39-win_amd64.whl", hash = "sha256:a918c8955b18b7a846a03735bf72d361190f1c04b6463bbe56b51d862f6d04e6"}, + {file = "blacksheep-2.0.7-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:7d707010d71f9a7d048966cac9f8e21eb772c7a04b54755ae9a2e51b3e888bea"}, + {file = "blacksheep-2.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0ef73603ccbb08cb161078f174be059c7ab6881534899891b76a46afde81f00"}, + {file = "blacksheep-2.0.7-cp310-cp310-win_amd64.whl", hash = "sha256:dd97981fb7e9ee22416df14a17cb88307202e49d90ce5fdd9f99d531c3eb3c2a"}, + {file = "blacksheep-2.0.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:676285158a3d3bdd77e5bf48805e6359d86ef718ad21895ad239c7f32b11e110"}, + {file = "blacksheep-2.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bcee81f0238ee5c10c7fc4d45a8a49cd012188ab9756c695922aa79c73cd1f5c"}, + {file = "blacksheep-2.0.7-cp311-cp311-win_amd64.whl", hash = "sha256:aff0e2503c5fc7237475533d788153c01acaf4d00bb7a0a62d7fcb526ed6ec62"}, + {file = "blacksheep-2.0.7-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:36f5c7cd30b36bc076aed972ba68645acde0af59e6c2a5b6ab301bc27ec7a01e"}, + {file = "blacksheep-2.0.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d451f4c18d7af1852ee6cc52ab7a0bb0c435d1d6cd6c22d4238d229400c25b8"}, + {file = "blacksheep-2.0.7-cp312-cp312-win_amd64.whl", hash = "sha256:fb2594c101241d4a983085667898a6f43024024d9722f8a3df16150f4bdd5d39"}, + {file = "blacksheep-2.0.7-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:f02abc213aa95f8d8453609b3e601da785f11712396a65f3945e5b9b66d20f1b"}, + {file = "blacksheep-2.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb826d920e5fc75e44f36de36b59b891d2c34004091083f8525c2373d0d4cf75"}, + {file = "blacksheep-2.0.7-cp38-cp38-win_amd64.whl", hash = "sha256:2f4cc63f9f18c56ae349d2f03c991fbc5affc6b871674c407b60d574be8683a6"}, + {file = "blacksheep-2.0.7-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:f0a8036eb9475d9387da6b9d21470e22a1acd5da17ea973f0e5f378846f2344d"}, + {file = "blacksheep-2.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81cf3c2adab437f1d8e25c54b9920434b47db78463a46108dfacc429bd52b286"}, + {file = "blacksheep-2.0.7-cp39-cp39-win_amd64.whl", hash = "sha256:cc6ab2376aa76189dd4c6e588e97aa67843d5df7ee95f8d4b8255d6fc1deab52"}, + {file = "blacksheep-2.0.7.tar.gz", hash = "sha256:ae192809c1e42de5a0d6230f1238d027641a8d889a4a9fb5349b7980f74afd88"}, ] [package.dependencies] -certifi = ">=2022.12.7" +certifi = ">=2022.9.24" charset-normalizer = ">=3.1.0,<3.2.0" essentials = ">=1.1.4,<2.0" -essentials-openapi = ">=0.1.4,<1.1" -guardpost = ">=0.0.9,<0.1.0" +essentials-openapi = ">=1.0.6,<1.1" +guardpost = ">=1.0.2" httptools = ">=0.5" itsdangerous = ">=2.1.2,<2.2.0" -Jinja2 = ">=3.1.2,<3.2.0" python-dateutil = ">=2.8.2,<2.9.0" -rodi = ">=1.1.1,<1.2.0" +rodi = ">=2.0.2,<2.1.0" [package.extras] -full = ["PyJWT (>=2.6.0,<2.7.0)", "cryptography (>=38.0.1,<38.1.0)", "websockets (>=10.3,<11.0)"] +full = ["PyJWT (>=2.6.0,<2.7.0)", "cryptography (>=38.0.1,<41.1.0)", "websockets (>=10.3,<11.0)"] +jinja = ["Jinja2 (>=3.1.2,<3.2.0)"] [[package]] name = "blinker" @@ -1206,17 +1210,20 @@ files = [ [[package]] name = "guardpost" -version = "0.0.9" -description = "Basic framework to handle authentication and authorization in any kind of Python application." +version = "1.0.2" +description = "Framework to handle authentication and authorization." optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "guardpost-0.0.9-py3-none-any.whl", hash = "sha256:a7ac4d9910ebc50114b275fcbbc4d2411e8a7d4b0d0b9824e0a1e9623583b804"}, - {file = "guardpost-0.0.9.tar.gz", hash = "sha256:4c309d6bb2975e55edb95f7ac5019b9cefeba43736ce71f6275156978aa75fc9"}, + {file = "guardpost-1.0.2-py3-none-any.whl", hash = "sha256:e7b7e5c61f776b055c7f4ee382ab78149bfe66f367f0e187574c3664e1740579"}, + {file = "guardpost-1.0.2.tar.gz", hash = "sha256:4566616c1bc01c148275ed8d1cd56f7dffeced490c7d8c599c90293308e55c94"}, ] +[package.dependencies] +rodi = ">=2.0.0" + [package.extras] -jwt = ["PyJWT (>=2.3.0,<2.4.0)", "cryptography (>=35.0.0,<35.1.0)"] +jwt = ["cryptography", "pyjwt"] [[package]] name = "h11" @@ -2157,18 +2164,18 @@ files = [ [[package]] name = "pydantic" -version = "2.6.1" +version = "2.7.1" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.6.1-py3-none-any.whl", hash = "sha256:0b6a909df3192245cb736509a92ff69e4fef76116feffec68e93a567347bae6f"}, - {file = "pydantic-2.6.1.tar.gz", hash = "sha256:4fd5c182a2488dc63e6d32737ff19937888001e2a6d86e94b3f233104a5d1fa9"}, + {file = "pydantic-2.7.1-py3-none-any.whl", hash = "sha256:e029badca45266732a9a79898a15ae2e8b14840b1eabbb25844be28f0b33f3d5"}, + {file = "pydantic-2.7.1.tar.gz", hash = "sha256:e9dbb5eada8abe4d9ae5f46b9939aead650cd2b68f249bb3a8139dbe125803cc"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.16.2" +pydantic-core = "2.18.2" typing-extensions = ">=4.6.1" [package.extras] @@ -2176,90 +2183,90 @@ email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.16.2" -description = "" +version = "2.18.2" +description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.16.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3fab4e75b8c525a4776e7630b9ee48aea50107fea6ca9f593c98da3f4d11bf7c"}, - {file = "pydantic_core-2.16.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8bde5b48c65b8e807409e6f20baee5d2cd880e0fad00b1a811ebc43e39a00ab2"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2924b89b16420712e9bb8192396026a8fbd6d8726224f918353ac19c4c043d2a"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:16aa02e7a0f539098e215fc193c8926c897175d64c7926d00a36188917717a05"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:936a787f83db1f2115ee829dd615c4f684ee48ac4de5779ab4300994d8af325b"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:459d6be6134ce3b38e0ef76f8a672924460c455d45f1ad8fdade36796df1ddc8"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9ee4febb249c591d07b2d4dd36ebcad0ccd128962aaa1801508320896575ef"}, - {file = "pydantic_core-2.16.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:40a0bd0bed96dae5712dab2aba7d334a6c67cbcac2ddfca7dbcc4a8176445990"}, - {file = "pydantic_core-2.16.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:870dbfa94de9b8866b37b867a2cb37a60c401d9deb4a9ea392abf11a1f98037b"}, - {file = "pydantic_core-2.16.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:308974fdf98046db28440eb3377abba274808bf66262e042c412eb2adf852731"}, - {file = "pydantic_core-2.16.2-cp310-none-win32.whl", hash = "sha256:a477932664d9611d7a0816cc3c0eb1f8856f8a42435488280dfbf4395e141485"}, - {file = "pydantic_core-2.16.2-cp310-none-win_amd64.whl", hash = "sha256:8f9142a6ed83d90c94a3efd7af8873bf7cefed2d3d44387bf848888482e2d25f"}, - {file = "pydantic_core-2.16.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:406fac1d09edc613020ce9cf3f2ccf1a1b2f57ab00552b4c18e3d5276c67eb11"}, - {file = "pydantic_core-2.16.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ce232a6170dd6532096cadbf6185271e4e8c70fc9217ebe105923ac105da9978"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a90fec23b4b05a09ad988e7a4f4e081711a90eb2a55b9c984d8b74597599180f"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8aafeedb6597a163a9c9727d8a8bd363a93277701b7bfd2749fbefee2396469e"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9957433c3a1b67bdd4c63717eaf174ebb749510d5ea612cd4e83f2d9142f3fc8"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0d7a9165167269758145756db43a133608a531b1e5bb6a626b9ee24bc38a8f7"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dffaf740fe2e147fedcb6b561353a16243e654f7fe8e701b1b9db148242e1272"}, - {file = "pydantic_core-2.16.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f8ed79883b4328b7f0bd142733d99c8e6b22703e908ec63d930b06be3a0e7113"}, - {file = "pydantic_core-2.16.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cf903310a34e14651c9de056fcc12ce090560864d5a2bb0174b971685684e1d8"}, - {file = "pydantic_core-2.16.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:46b0d5520dbcafea9a8645a8164658777686c5c524d381d983317d29687cce97"}, - {file = "pydantic_core-2.16.2-cp311-none-win32.whl", hash = "sha256:70651ff6e663428cea902dac297066d5c6e5423fda345a4ca62430575364d62b"}, - {file = "pydantic_core-2.16.2-cp311-none-win_amd64.whl", hash = "sha256:98dc6f4f2095fc7ad277782a7c2c88296badcad92316b5a6e530930b1d475ebc"}, - {file = "pydantic_core-2.16.2-cp311-none-win_arm64.whl", hash = "sha256:ef6113cd31411eaf9b39fc5a8848e71c72656fd418882488598758b2c8c6dfa0"}, - {file = "pydantic_core-2.16.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:88646cae28eb1dd5cd1e09605680c2b043b64d7481cdad7f5003ebef401a3039"}, - {file = "pydantic_core-2.16.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7b883af50eaa6bb3299780651e5be921e88050ccf00e3e583b1e92020333304b"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bf26c2e2ea59d32807081ad51968133af3025c4ba5753e6a794683d2c91bf6e"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:99af961d72ac731aae2a1b55ccbdae0733d816f8bfb97b41909e143de735f522"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:02906e7306cb8c5901a1feb61f9ab5e5c690dbbeaa04d84c1b9ae2a01ebe9379"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5362d099c244a2d2f9659fb3c9db7c735f0004765bbe06b99be69fbd87c3f15"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ac426704840877a285d03a445e162eb258924f014e2f074e209d9b4ff7bf380"}, - {file = "pydantic_core-2.16.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b94cbda27267423411c928208e89adddf2ea5dd5f74b9528513f0358bba019cb"}, - {file = "pydantic_core-2.16.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:6db58c22ac6c81aeac33912fb1af0e930bc9774166cdd56eade913d5f2fff35e"}, - {file = "pydantic_core-2.16.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:396fdf88b1b503c9c59c84a08b6833ec0c3b5ad1a83230252a9e17b7dfb4cffc"}, - {file = "pydantic_core-2.16.2-cp312-none-win32.whl", hash = "sha256:7c31669e0c8cc68400ef0c730c3a1e11317ba76b892deeefaf52dcb41d56ed5d"}, - {file = "pydantic_core-2.16.2-cp312-none-win_amd64.whl", hash = "sha256:a3b7352b48fbc8b446b75f3069124e87f599d25afb8baa96a550256c031bb890"}, - {file = "pydantic_core-2.16.2-cp312-none-win_arm64.whl", hash = "sha256:a9e523474998fb33f7c1a4d55f5504c908d57add624599e095c20fa575b8d943"}, - {file = "pydantic_core-2.16.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:ae34418b6b389d601b31153b84dce480351a352e0bb763684a1b993d6be30f17"}, - {file = "pydantic_core-2.16.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:732bd062c9e5d9582a30e8751461c1917dd1ccbdd6cafb032f02c86b20d2e7ec"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b52776a2e3230f4854907a1e0946eec04d41b1fc64069ee774876bbe0eab55"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ef551c053692b1e39e3f7950ce2296536728871110e7d75c4e7753fb30ca87f4"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ebb892ed8599b23fa8f1799e13a12c87a97a6c9d0f497525ce9858564c4575a4"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aa6c8c582036275997a733427b88031a32ffa5dfc3124dc25a730658c47a572f"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4ba0884a91f1aecce75202473ab138724aa4fb26d7707f2e1fa6c3e68c84fbf"}, - {file = "pydantic_core-2.16.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7924e54f7ce5d253d6160090ddc6df25ed2feea25bfb3339b424a9dd591688bc"}, - {file = "pydantic_core-2.16.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69a7b96b59322a81c2203be537957313b07dd333105b73db0b69212c7d867b4b"}, - {file = "pydantic_core-2.16.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:7e6231aa5bdacda78e96ad7b07d0c312f34ba35d717115f4b4bff6cb87224f0f"}, - {file = "pydantic_core-2.16.2-cp38-none-win32.whl", hash = "sha256:41dac3b9fce187a25c6253ec79a3f9e2a7e761eb08690e90415069ea4a68ff7a"}, - {file = "pydantic_core-2.16.2-cp38-none-win_amd64.whl", hash = "sha256:f685dbc1fdadb1dcd5b5e51e0a378d4685a891b2ddaf8e2bba89bd3a7144e44a"}, - {file = "pydantic_core-2.16.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:55749f745ebf154c0d63d46c8c58594d8894b161928aa41adbb0709c1fe78b77"}, - {file = "pydantic_core-2.16.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b30b0dd58a4509c3bd7eefddf6338565c4905406aee0c6e4a5293841411a1286"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18de31781cdc7e7b28678df7c2d7882f9692ad060bc6ee3c94eb15a5d733f8f7"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5864b0242f74b9dd0b78fd39db1768bc3f00d1ffc14e596fd3e3f2ce43436a33"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8f9186ca45aee030dc8234118b9c0784ad91a0bb27fc4e7d9d6608a5e3d386c"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cc6f6c9be0ab6da37bc77c2dda5f14b1d532d5dbef00311ee6e13357a418e646"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa057095f621dad24a1e906747179a69780ef45cc8f69e97463692adbcdae878"}, - {file = "pydantic_core-2.16.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6ad84731a26bcfb299f9eab56c7932d46f9cad51c52768cace09e92a19e4cf55"}, - {file = "pydantic_core-2.16.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3b052c753c4babf2d1edc034c97851f867c87d6f3ea63a12e2700f159f5c41c3"}, - {file = "pydantic_core-2.16.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e0f686549e32ccdb02ae6f25eee40cc33900910085de6aa3790effd391ae10c2"}, - {file = "pydantic_core-2.16.2-cp39-none-win32.whl", hash = "sha256:7afb844041e707ac9ad9acad2188a90bffce2c770e6dc2318be0c9916aef1469"}, - {file = "pydantic_core-2.16.2-cp39-none-win_amd64.whl", hash = "sha256:9da90d393a8227d717c19f5397688a38635afec89f2e2d7af0df037f3249c39a"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5f60f920691a620b03082692c378661947d09415743e437a7478c309eb0e4f82"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:47924039e785a04d4a4fa49455e51b4eb3422d6eaacfde9fc9abf8fdef164e8a"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e6294e76b0380bb7a61eb8a39273c40b20beb35e8c87ee101062834ced19c545"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe56851c3f1d6f5384b3051c536cc81b3a93a73faf931f404fef95217cf1e10d"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9d776d30cde7e541b8180103c3f294ef7c1862fd45d81738d156d00551005784"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:72f7919af5de5ecfaf1eba47bf9a5d8aa089a3340277276e5636d16ee97614d7"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:4bfcbde6e06c56b30668a0c872d75a7ef3025dc3c1823a13cf29a0e9b33f67e8"}, - {file = "pydantic_core-2.16.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ff7c97eb7a29aba230389a2661edf2e9e06ce616c7e35aa764879b6894a44b25"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:9b5f13857da99325dcabe1cc4e9e6a3d7b2e2c726248ba5dd4be3e8e4a0b6d0e"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:a7e41e3ada4cca5f22b478c08e973c930e5e6c7ba3588fb8e35f2398cdcc1545"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:60eb8ceaa40a41540b9acae6ae7c1f0a67d233c40dc4359c256ad2ad85bdf5e5"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7beec26729d496a12fd23cf8da9944ee338c8b8a17035a560b585c36fe81af20"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:22c5f022799f3cd6741e24f0443ead92ef42be93ffda0d29b2597208c94c3753"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:eca58e319f4fd6df004762419612122b2c7e7d95ffafc37e890252f869f3fb2a"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ed957db4c33bc99895f3a1672eca7e80e8cda8bd1e29a80536b4ec2153fa9804"}, - {file = "pydantic_core-2.16.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:459c0d338cc55d099798618f714b21b7ece17eb1a87879f2da20a3ff4c7628e2"}, - {file = "pydantic_core-2.16.2.tar.gz", hash = "sha256:0ba503850d8b8dcc18391f10de896ae51d37fe5fe43dbfb6a35c5c5cad271a06"}, + {file = "pydantic_core-2.18.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:9e08e867b306f525802df7cd16c44ff5ebbe747ff0ca6cf3fde7f36c05a59a81"}, + {file = "pydantic_core-2.18.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f0a21cbaa69900cbe1a2e7cad2aa74ac3cf21b10c3efb0fa0b80305274c0e8a2"}, + {file = "pydantic_core-2.18.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0680b1f1f11fda801397de52c36ce38ef1c1dc841a0927a94f226dea29c3ae3d"}, + {file = "pydantic_core-2.18.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:95b9d5e72481d3780ba3442eac863eae92ae43a5f3adb5b4d0a1de89d42bb250"}, + {file = "pydantic_core-2.18.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4fcf5cd9c4b655ad666ca332b9a081112cd7a58a8b5a6ca7a3104bc950f2038"}, + {file = "pydantic_core-2.18.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b5155ff768083cb1d62f3e143b49a8a3432e6789a3abee8acd005c3c7af1c74"}, + {file = "pydantic_core-2.18.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:553ef617b6836fc7e4df130bb851e32fe357ce36336d897fd6646d6058d980af"}, + {file = "pydantic_core-2.18.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b89ed9eb7d616ef5714e5590e6cf7f23b02d0d539767d33561e3675d6f9e3857"}, + {file = "pydantic_core-2.18.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:75f7e9488238e920ab6204399ded280dc4c307d034f3924cd7f90a38b1829563"}, + {file = "pydantic_core-2.18.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ef26c9e94a8c04a1b2924149a9cb081836913818e55681722d7f29af88fe7b38"}, + {file = "pydantic_core-2.18.2-cp310-none-win32.whl", hash = "sha256:182245ff6b0039e82b6bb585ed55a64d7c81c560715d1bad0cbad6dfa07b4027"}, + {file = "pydantic_core-2.18.2-cp310-none-win_amd64.whl", hash = "sha256:e23ec367a948b6d812301afc1b13f8094ab7b2c280af66ef450efc357d2ae543"}, + {file = "pydantic_core-2.18.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:219da3f096d50a157f33645a1cf31c0ad1fe829a92181dd1311022f986e5fbe3"}, + {file = "pydantic_core-2.18.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:cc1cfd88a64e012b74e94cd00bbe0f9c6df57049c97f02bb07d39e9c852e19a4"}, + {file = "pydantic_core-2.18.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:05b7133a6e6aeb8df37d6f413f7705a37ab4031597f64ab56384c94d98fa0e90"}, + {file = "pydantic_core-2.18.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:224c421235f6102e8737032483f43c1a8cfb1d2f45740c44166219599358c2cd"}, + {file = "pydantic_core-2.18.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b14d82cdb934e99dda6d9d60dc84a24379820176cc4a0d123f88df319ae9c150"}, + {file = "pydantic_core-2.18.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2728b01246a3bba6de144f9e3115b532ee44bd6cf39795194fb75491824a1413"}, + {file = "pydantic_core-2.18.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:470b94480bb5ee929f5acba6995251ada5e059a5ef3e0dfc63cca287283ebfa6"}, + {file = "pydantic_core-2.18.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:997abc4df705d1295a42f95b4eec4950a37ad8ae46d913caeee117b6b198811c"}, + {file = "pydantic_core-2.18.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:75250dbc5290e3f1a0f4618db35e51a165186f9034eff158f3d490b3fed9f8a0"}, + {file = "pydantic_core-2.18.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4456f2dca97c425231d7315737d45239b2b51a50dc2b6f0c2bb181fce6207664"}, + {file = "pydantic_core-2.18.2-cp311-none-win32.whl", hash = "sha256:269322dcc3d8bdb69f054681edff86276b2ff972447863cf34c8b860f5188e2e"}, + {file = "pydantic_core-2.18.2-cp311-none-win_amd64.whl", hash = "sha256:800d60565aec896f25bc3cfa56d2277d52d5182af08162f7954f938c06dc4ee3"}, + {file = "pydantic_core-2.18.2-cp311-none-win_arm64.whl", hash = "sha256:1404c69d6a676245199767ba4f633cce5f4ad4181f9d0ccb0577e1f66cf4c46d"}, + {file = "pydantic_core-2.18.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:fb2bd7be70c0fe4dfd32c951bc813d9fe6ebcbfdd15a07527796c8204bd36242"}, + {file = "pydantic_core-2.18.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6132dd3bd52838acddca05a72aafb6eab6536aa145e923bb50f45e78b7251043"}, + {file = "pydantic_core-2.18.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7d904828195733c183d20a54230c0df0eb46ec746ea1a666730787353e87182"}, + {file = "pydantic_core-2.18.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c9bd70772c720142be1020eac55f8143a34ec9f82d75a8e7a07852023e46617f"}, + {file = "pydantic_core-2.18.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2b8ed04b3582771764538f7ee7001b02e1170223cf9b75dff0bc698fadb00cf3"}, + {file = "pydantic_core-2.18.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e6dac87ddb34aaec85f873d737e9d06a3555a1cc1a8e0c44b7f8d5daeb89d86f"}, + {file = "pydantic_core-2.18.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ca4ae5a27ad7a4ee5170aebce1574b375de390bc01284f87b18d43a3984df72"}, + {file = "pydantic_core-2.18.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:886eec03591b7cf058467a70a87733b35f44707bd86cf64a615584fd72488b7c"}, + {file = "pydantic_core-2.18.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ca7b0c1f1c983e064caa85f3792dd2fe3526b3505378874afa84baf662e12241"}, + {file = "pydantic_core-2.18.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4b4356d3538c3649337df4074e81b85f0616b79731fe22dd11b99499b2ebbdf3"}, + {file = "pydantic_core-2.18.2-cp312-none-win32.whl", hash = "sha256:8b172601454f2d7701121bbec3425dd71efcb787a027edf49724c9cefc14c038"}, + {file = "pydantic_core-2.18.2-cp312-none-win_amd64.whl", hash = "sha256:b1bd7e47b1558ea872bd16c8502c414f9e90dcf12f1395129d7bb42a09a95438"}, + {file = "pydantic_core-2.18.2-cp312-none-win_arm64.whl", hash = "sha256:98758d627ff397e752bc339272c14c98199c613f922d4a384ddc07526c86a2ec"}, + {file = "pydantic_core-2.18.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:9fdad8e35f278b2c3eb77cbdc5c0a49dada440657bf738d6905ce106dc1de439"}, + {file = "pydantic_core-2.18.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1d90c3265ae107f91a4f279f4d6f6f1d4907ac76c6868b27dc7fb33688cfb347"}, + {file = "pydantic_core-2.18.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:390193c770399861d8df9670fb0d1874f330c79caaca4642332df7c682bf6b91"}, + {file = "pydantic_core-2.18.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:82d5d4d78e4448683cb467897fe24e2b74bb7b973a541ea1dcfec1d3cbce39fb"}, + {file = "pydantic_core-2.18.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4774f3184d2ef3e14e8693194f661dea5a4d6ca4e3dc8e39786d33a94865cefd"}, + {file = "pydantic_core-2.18.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d4d938ec0adf5167cb335acb25a4ee69a8107e4984f8fbd2e897021d9e4ca21b"}, + {file = "pydantic_core-2.18.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e0e8b1be28239fc64a88a8189d1df7fad8be8c1ae47fcc33e43d4be15f99cc70"}, + {file = "pydantic_core-2.18.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:868649da93e5a3d5eacc2b5b3b9235c98ccdbfd443832f31e075f54419e1b96b"}, + {file = "pydantic_core-2.18.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:78363590ef93d5d226ba21a90a03ea89a20738ee5b7da83d771d283fd8a56761"}, + {file = "pydantic_core-2.18.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:852e966fbd035a6468fc0a3496589b45e2208ec7ca95c26470a54daed82a0788"}, + {file = "pydantic_core-2.18.2-cp38-none-win32.whl", hash = "sha256:6a46e22a707e7ad4484ac9ee9f290f9d501df45954184e23fc29408dfad61350"}, + {file = "pydantic_core-2.18.2-cp38-none-win_amd64.whl", hash = "sha256:d91cb5ea8b11607cc757675051f61b3d93f15eca3cefb3e6c704a5d6e8440f4e"}, + {file = "pydantic_core-2.18.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:ae0a8a797a5e56c053610fa7be147993fe50960fa43609ff2a9552b0e07013e8"}, + {file = "pydantic_core-2.18.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:042473b6280246b1dbf530559246f6842b56119c2926d1e52b631bdc46075f2a"}, + {file = "pydantic_core-2.18.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a388a77e629b9ec814c1b1e6b3b595fe521d2cdc625fcca26fbc2d44c816804"}, + {file = "pydantic_core-2.18.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e25add29b8f3b233ae90ccef2d902d0ae0432eb0d45370fe315d1a5cf231004b"}, + {file = "pydantic_core-2.18.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f459a5ce8434614dfd39bbebf1041952ae01da6bed9855008cb33b875cb024c0"}, + {file = "pydantic_core-2.18.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eff2de745698eb46eeb51193a9f41d67d834d50e424aef27df2fcdee1b153845"}, + {file = "pydantic_core-2.18.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8309f67285bdfe65c372ea3722b7a5642680f3dba538566340a9d36e920b5f0"}, + {file = "pydantic_core-2.18.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f93a8a2e3938ff656a7c1bc57193b1319960ac015b6e87d76c76bf14fe0244b4"}, + {file = "pydantic_core-2.18.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:22057013c8c1e272eb8d0eebc796701167d8377441ec894a8fed1af64a0bf399"}, + {file = "pydantic_core-2.18.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:cfeecd1ac6cc1fb2692c3d5110781c965aabd4ec5d32799773ca7b1456ac636b"}, + {file = "pydantic_core-2.18.2-cp39-none-win32.whl", hash = "sha256:0d69b4c2f6bb3e130dba60d34c0845ba31b69babdd3f78f7c0c8fae5021a253e"}, + {file = "pydantic_core-2.18.2-cp39-none-win_amd64.whl", hash = "sha256:d9319e499827271b09b4e411905b24a426b8fb69464dfa1696258f53a3334641"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a1874c6dd4113308bd0eb568418e6114b252afe44319ead2b4081e9b9521fe75"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:ccdd111c03bfd3666bd2472b674c6899550e09e9f298954cfc896ab92b5b0e6d"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e18609ceaa6eed63753037fc06ebb16041d17d28199ae5aba0052c51449650a9"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e5c584d357c4e2baf0ff7baf44f4994be121e16a2c88918a5817331fc7599d7"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:43f0f463cf89ace478de71a318b1b4f05ebc456a9b9300d027b4b57c1a2064fb"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:e1b395e58b10b73b07b7cf740d728dd4ff9365ac46c18751bf8b3d8cca8f625a"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0098300eebb1c837271d3d1a2cd2911e7c11b396eac9661655ee524a7f10587b"}, + {file = "pydantic_core-2.18.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:36789b70d613fbac0a25bb07ab3d9dba4d2e38af609c020cf4d888d165ee0bf3"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3f9a801e7c8f1ef8718da265bba008fa121243dfe37c1cea17840b0944dfd72c"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:3a6515ebc6e69d85502b4951d89131ca4e036078ea35533bb76327f8424531ce"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20aca1e2298c56ececfd8ed159ae4dde2df0781988c97ef77d5c16ff4bd5b400"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:223ee893d77a310a0391dca6df00f70bbc2f36a71a895cecd9a0e762dc37b349"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2334ce8c673ee93a1d6a65bd90327588387ba073c17e61bf19b4fd97d688d63c"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:cbca948f2d14b09d20268cda7b0367723d79063f26c4ffc523af9042cad95592"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b3ef08e20ec49e02d5c6717a91bb5af9b20f1805583cb0adfe9ba2c6b505b5ae"}, + {file = "pydantic_core-2.18.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c6fdc8627910eed0c01aed6a390a252fe3ea6d472ee70fdde56273f198938374"}, + {file = "pydantic_core-2.18.2.tar.gz", hash = "sha256:2e29d20810dfc3043ee13ac7d9e25105799817683348823f305ab3f349b9386e"}, ] [package.dependencies] @@ -2514,6 +2521,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -2665,13 +2673,13 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "rodi" -version = "1.1.3" +version = "2.0.6" description = "Implementation of dependency injection for Python 3" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "rodi-1.1.3-py3-none-any.whl", hash = "sha256:d30a34b5dd15200754bccf84cbd57d8be2bcf1da65510b6439d1922c2a185844"}, - {file = "rodi-1.1.3.tar.gz", hash = "sha256:18bd3efccd5045920a27784ebd5fd01b48e8dbeb5d5dc3d880921ff69153446a"}, + {file = "rodi-2.0.6-py3-none-any.whl", hash = "sha256:d299276be19842133def84dde365771d11a5195b76be0595eae9c1ecad818446"}, + {file = "rodi-2.0.6.tar.gz", hash = "sha256:f533e315d84b63824efcc67526a156ad5fb0a158f1ccbc41e0db3944d0c08693"}, ] [[package]] @@ -3494,4 +3502,4 @@ psycopg = ["psycopg"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "453b66f9e85c48eb7f88fb87827d78acec0086cd80acbeb09112757fa552ebde" +content-hash = "299e5a492a12bdad51cd7708f9be04a786993b3d3ae3fbfffe06b666e90328f9" diff --git a/pyproject.toml b/pyproject.toml index 0780d415d..7d7ace03d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,7 @@ httpx = "*" # Aiohttp support aiohttp = "*" # BlackSheep support -blacksheep = "^1.0.9" +blacksheep = "^2.0.7" # mypy types-PyYAML = "*" types-pytz = "*" diff --git a/tests/backends/test_mysql.py b/tests/backends/test_mysql.py index 4f5b427df..8dd72133a 100644 --- a/tests/backends/test_mysql.py +++ b/tests/backends/test_mysql.py @@ -1,6 +1,7 @@ """ Test some mysql-specific features """ + import ssl from tortoise import Tortoise diff --git a/tests/backends/test_postgres.py b/tests/backends/test_postgres.py index 25b52d60f..e190c70fb 100644 --- a/tests/backends/test_postgres.py +++ b/tests/backends/test_postgres.py @@ -1,6 +1,7 @@ """ Test some PostgreSQL-specific features """ + import ssl from tests.testmodels import Tournament diff --git a/tests/model_setup/model_bad_rel1.py b/tests/model_setup/model_bad_rel1.py index ebcef5602..1318cafc5 100644 --- a/tests/model_setup/model_bad_rel1.py +++ b/tests/model_setup/model_bad_rel1.py @@ -1,6 +1,7 @@ """ Testing Models for a bad/wrong relation reference """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_bad_rel2.py b/tests/model_setup/model_bad_rel2.py index 7d6ae9e3f..2fd757560 100644 --- a/tests/model_setup/model_bad_rel2.py +++ b/tests/model_setup/model_bad_rel2.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference The model 'Tour' does not exist """ + from typing import Any from tortoise import fields diff --git a/tests/model_setup/model_bad_rel3.py b/tests/model_setup/model_bad_rel3.py index ac0746097..8ceec28cb 100644 --- a/tests/model_setup/model_bad_rel3.py +++ b/tests/model_setup/model_bad_rel3.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference Wrong reference. App missing. """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_bad_rel4.py b/tests/model_setup/model_bad_rel4.py index a32cdddb2..ff89d2a1f 100644 --- a/tests/model_setup/model_bad_rel4.py +++ b/tests/model_setup/model_bad_rel4.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference Wrong reference. Two '.' in reference. """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_bad_rel5.py b/tests/model_setup/model_bad_rel5.py index c9e08b8b7..bdeb6599c 100644 --- a/tests/model_setup/model_bad_rel5.py +++ b/tests/model_setup/model_bad_rel5.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference Wrong reference. App missing. """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_bad_rel6.py b/tests/model_setup/model_bad_rel6.py index b2b396cb4..e2bd49285 100644 --- a/tests/model_setup/model_bad_rel6.py +++ b/tests/model_setup/model_bad_rel6.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference Wrong reference. fk field parameter `to_field` with non unique field. """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_bad_rel7.py b/tests/model_setup/model_bad_rel7.py index 2f1d50738..2ed5dbd0a 100644 --- a/tests/model_setup/model_bad_rel7.py +++ b/tests/model_setup/model_bad_rel7.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference Wrong reference. fk field parameter `to_field` with non exist field. """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_bad_rel8.py b/tests/model_setup/model_bad_rel8.py index 3eaeec001..731f3d77a 100644 --- a/tests/model_setup/model_bad_rel8.py +++ b/tests/model_setup/model_bad_rel8.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference Wrong reference. o2o field parameter `to_field` with non unique field. """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_bad_rel9.py b/tests/model_setup/model_bad_rel9.py index d2dda1ee8..d4d8366f7 100644 --- a/tests/model_setup/model_bad_rel9.py +++ b/tests/model_setup/model_bad_rel9.py @@ -2,6 +2,7 @@ Testing Models for a bad/wrong relation reference Wrong reference. o2o field parameter `to_field` with non exist field. """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_generated_nonint.py b/tests/model_setup/model_generated_nonint.py index 6bd22ccec..9b4e962c8 100644 --- a/tests/model_setup/model_generated_nonint.py +++ b/tests/model_setup/model_generated_nonint.py @@ -1,6 +1,7 @@ """ This is the testing Models — Generated non-int PK """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_multiple_pk.py b/tests/model_setup/model_multiple_pk.py index db6e7e92c..41e31dd29 100644 --- a/tests/model_setup/model_multiple_pk.py +++ b/tests/model_setup/model_multiple_pk.py @@ -1,6 +1,7 @@ """ This is the testing Models — Multiple PK """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/model_setup/model_nonpk_id.py b/tests/model_setup/model_nonpk_id.py index 1fada43de..86d1d9454 100644 --- a/tests/model_setup/model_nonpk_id.py +++ b/tests/model_setup/model_nonpk_id.py @@ -1,6 +1,7 @@ """ This is the testing Models — Model with field id, but NO PK """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/schema/models_cyclic.py b/tests/schema/models_cyclic.py index 6ccdcb024..4de3e09db 100644 --- a/tests/schema/models_cyclic.py +++ b/tests/schema/models_cyclic.py @@ -1,6 +1,7 @@ """ This is the testing Models — Cyclic """ + from tortoise import fields from tortoise.models import Model diff --git a/tests/schema/models_fk_1.py b/tests/schema/models_fk_1.py index 58e3bdd59..f82fd3df4 100644 --- a/tests/schema/models_fk_1.py +++ b/tests/schema/models_fk_1.py @@ -1,6 +1,7 @@ """ This is the testing Models — FK bad model name """ + from typing import Any from tortoise import fields diff --git a/tests/schema/models_fk_2.py b/tests/schema/models_fk_2.py index 33de79ea0..82878df0a 100644 --- a/tests/schema/models_fk_2.py +++ b/tests/schema/models_fk_2.py @@ -1,6 +1,7 @@ """ This is the testing Models — Bad on_delete parameter """ + from tests.schema.models_cyclic import Two from tortoise import fields from tortoise.models import Model diff --git a/tests/schema/models_fk_3.py b/tests/schema/models_fk_3.py index 8d02a4d95..07035d877 100644 --- a/tests/schema/models_fk_3.py +++ b/tests/schema/models_fk_3.py @@ -1,6 +1,7 @@ """ This is the testing Models — on_delete SET_NULL without null=True """ + from tests.schema.models_cyclic import Two from tortoise import fields from tortoise.models import Model diff --git a/tests/schema/models_m2m_1.py b/tests/schema/models_m2m_1.py index 75cf7bc2f..b3d027ccf 100644 --- a/tests/schema/models_m2m_1.py +++ b/tests/schema/models_m2m_1.py @@ -1,6 +1,7 @@ """ This is the testing Models — Cyclic """ + from tests.schema.models_cyclic import Two from tortoise import fields from tortoise.models import Model diff --git a/tests/schema/models_o2o_2.py b/tests/schema/models_o2o_2.py index 40f3e9e87..829557bdc 100644 --- a/tests/schema/models_o2o_2.py +++ b/tests/schema/models_o2o_2.py @@ -1,6 +1,7 @@ """ This is the testing Models — Bad on_delete parameter """ + from tests.schema.models_cyclic import Two from tortoise import fields from tortoise.models import Model diff --git a/tests/schema/models_o2o_3.py b/tests/schema/models_o2o_3.py index 0e6f025ac..b02adb364 100644 --- a/tests/schema/models_o2o_3.py +++ b/tests/schema/models_o2o_3.py @@ -1,6 +1,7 @@ """ This is the testing Models — on_delete SET_NULL without null=True """ + from tests.schema.models_cyclic import Two from tortoise import fields from tortoise.models import Model diff --git a/tests/schema/models_schema_create.py b/tests/schema/models_schema_create.py index 9bb640fcc..ebf7bcf19 100644 --- a/tests/schema/models_schema_create.py +++ b/tests/schema/models_schema_create.py @@ -1,6 +1,7 @@ """ This example demonstrates SQL Schema generation for each DB type supported. """ + from uuid import uuid4 from tortoise import fields diff --git a/tests/test_source_field.py b/tests/test_source_field.py index ad8d43ef5..34f995c66 100644 --- a/tests/test_source_field.py +++ b/tests/test_source_field.py @@ -4,6 +4,7 @@ This is to test that behaviour doesn't change when one defined source_field parameters. """ + from tests.testmodels import NumberSourceField, SourceFields, StraightFields from tortoise.contrib import test from tortoise.contrib.test.condition import NotEQ diff --git a/tests/testmodels.py b/tests/testmodels.py index 9ddc02e9d..b7385371a 100644 --- a/tests/testmodels.py +++ b/tests/testmodels.py @@ -1,6 +1,7 @@ """ This is the testing Models """ + import binascii import datetime import os diff --git a/tortoise/__init__.py b/tortoise/__init__.py index ad39ff45a..fff105670 100644 --- a/tortoise/__init__.py +++ b/tortoise/__init__.py @@ -311,9 +311,9 @@ def split_reference(reference: str) -> Tuple[str, str]: backward_relation_name = m2m_object.related_name if not backward_relation_name: - backward_relation_name = ( - m2m_object.related_name - ) = f"{model._meta.db_table}s" + backward_relation_name = m2m_object.related_name = ( + f"{model._meta.db_table}s" + ) if backward_relation_name in related_model._meta.fields: raise ConfigurationError( f'backward relation "{backward_relation_name}" duplicates in' diff --git a/tortoise/backends/base/schema_generator.py b/tortoise/backends/base/schema_generator.py index ac07d117f..c7b328f92 100644 --- a/tortoise/backends/base/schema_generator.py +++ b/tortoise/backends/base/schema_generator.py @@ -351,26 +351,30 @@ def _get_table_sql(self, model: "Type[Model]", safe: bool = True) -> dict: m2m_create_string = self.M2M_TABLE_TEMPLATE.format( exists="IF NOT EXISTS " if safe else "", table_name=field_object.through, - backward_fk=self._create_fk_string( - "", - field_object.backward_key, - model._meta.db_table, - model._meta.db_pk_column, - field_object.on_delete, - "", - ) - if field_object.db_constraint - else "", - forward_fk=self._create_fk_string( - "", - field_object.forward_key, - field_object.related_model._meta.db_table, - field_object.related_model._meta.db_pk_column, - field_object.on_delete, - "", - ) - if field_object.db_constraint - else "", + backward_fk=( + self._create_fk_string( + "", + field_object.backward_key, + model._meta.db_table, + model._meta.db_pk_column, + field_object.on_delete, + "", + ) + if field_object.db_constraint + else "" + ), + forward_fk=( + self._create_fk_string( + "", + field_object.forward_key, + field_object.related_model._meta.db_table, + field_object.related_model._meta.db_pk_column, + field_object.on_delete, + "", + ) + if field_object.db_constraint + else "" + ), backward_key=field_object.backward_key, backward_type=model._meta.pk.get_for_dialect(self.DIALECT, "SQL_TYPE"), forward_key=field_object.forward_key, @@ -378,11 +382,13 @@ def _get_table_sql(self, model: "Type[Model]", safe: bool = True) -> dict: self.DIALECT, "SQL_TYPE" ), extra=self._table_generate_extra(table=field_object.through), - comment=self._table_comment_generator( - table=field_object.through, comment=field_object.description - ) - if field_object.description - else "", + comment=( + self._table_comment_generator( + table=field_object.through, comment=field_object.description + ) + if field_object.description + else "" + ), ) if not field_object.db_constraint: m2m_create_string = m2m_create_string.replace( diff --git a/tortoise/contrib/pydantic/creator.py b/tortoise/contrib/pydantic/creator.py index 87c08f096..10346b268 100644 --- a/tortoise/contrib/pydantic/creator.py +++ b/tortoise/contrib/pydantic/creator.py @@ -36,7 +36,7 @@ class PydanticMeta: include: Tuple[str, ...] = () #: Fields listed in this property will be excluded from pydantic model - exclude: Tuple[str, ...] = () + exclude: Tuple[str, ...] = ("Meta",) #: Computed fields can be listed here to use in pydantic model computed: Tuple[str, ...] = () diff --git a/tortoise/contrib/pylint/__init__.py b/tortoise/contrib/pylint/__init__.py index 9b5716cf3..68bd2dea0 100644 --- a/tortoise/contrib/pylint/__init__.py +++ b/tortoise/contrib/pylint/__init__.py @@ -1,6 +1,7 @@ """ Tortoise PyLint plugin """ + from typing import Any, Dict, Iterator, List from astroid import MANAGER, inference_tip, nodes diff --git a/tortoise/fields/base.py b/tortoise/fields/base.py index 36c44b874..7d2ac3925 100644 --- a/tortoise/fields/base.py +++ b/tortoise/fields/base.py @@ -159,20 +159,16 @@ def __new__(cls, *args: Any, **kwargs: Any) -> "Field[VALUE]": return super().__new__(cls) @overload - def __get__(self, instance: None, owner: Type["Model"]) -> "Field[VALUE]": - ... + def __get__(self, instance: None, owner: Type["Model"]) -> "Field[VALUE]": ... @overload - def __get__(self, instance: "Model", owner: Type["Model"]) -> VALUE: - ... + def __get__(self, instance: "Model", owner: Type["Model"]) -> VALUE: ... def __get__( self, instance: Optional["Model"], owner: Type["Model"] - ) -> "Field[VALUE] | VALUE": - ... + ) -> "Field[VALUE] | VALUE": ... - def __set__(self, instance: "Model", value: VALUE) -> None: - ... + def __set__(self, instance: "Model", value: VALUE) -> None: ... def __init__( self, diff --git a/tortoise/fields/relational.py b/tortoise/fields/relational.py index 2bc268d2e..2442b7dec 100644 --- a/tortoise/fields/relational.py +++ b/tortoise/fields/relational.py @@ -289,20 +289,16 @@ def __init__( if TYPE_CHECKING: @overload - def __get__(self, instance: None, owner: Type["Model"]) -> "RelationalField[MODEL]": - ... + def __get__(self, instance: None, owner: Type["Model"]) -> "RelationalField[MODEL]": ... @overload - def __get__(self, instance: "Model", owner: Type["Model"]) -> MODEL: - ... + def __get__(self, instance: "Model", owner: Type["Model"]) -> MODEL: ... def __get__( self, instance: Optional["Model"], owner: Type["Model"] - ) -> "RelationalField[MODEL] | MODEL": - ... + ) -> "RelationalField[MODEL] | MODEL": ... - def __set__(self, instance: "Model", value: MODEL) -> None: - ... + def __set__(self, instance: "Model", value: MODEL) -> None: ... def describe(self, serializable: bool) -> dict: desc = super().describe(serializable) @@ -420,8 +416,7 @@ def OneToOneField( *, null: Literal[True], **kwargs: Any, -) -> "OneToOneNullableRelation[MODEL]": - ... +) -> "OneToOneNullableRelation[MODEL]": ... @overload @@ -432,8 +427,7 @@ def OneToOneField( db_constraint: bool = True, null: Literal[False] = False, **kwargs: Any, -) -> "OneToOneRelation[MODEL]": - ... +) -> "OneToOneRelation[MODEL]": ... def OneToOneField( @@ -497,8 +491,7 @@ def ForeignKeyField( *, null: Literal[True], **kwargs: Any, -) -> "ForeignKeyNullableRelation[MODEL]": - ... +) -> "ForeignKeyNullableRelation[MODEL]": ... @overload @@ -509,8 +502,7 @@ def ForeignKeyField( db_constraint: bool = True, null: Literal[False] = False, **kwargs: Any, -) -> "ForeignKeyRelation[MODEL]": - ... +) -> "ForeignKeyRelation[MODEL]": ... def ForeignKeyField( diff --git a/tortoise/queryset.py b/tortoise/queryset.py index dee321f3e..25f02ecf3 100644 --- a/tortoise/queryset.py +++ b/tortoise/queryset.py @@ -63,30 +63,36 @@ class QuerySetSingle(Protocol[T_co]): """ # pylint: disable=W0104 - def __await__(self) -> Generator[Any, None, T_co]: - ... # pragma: nocoverage + def __await__(self) -> Generator[Any, None, T_co]: ... # pragma: nocoverage - def prefetch_related(self, *args: Union[str, Prefetch]) -> "QuerySetSingle[T_co]": - ... # pragma: nocoverage + def prefetch_related( + self, *args: Union[str, Prefetch] + ) -> "QuerySetSingle[T_co]": ... # pragma: nocoverage - def select_related(self, *args: str) -> "QuerySetSingle[T_co]": - ... # pragma: nocoverage + def select_related(self, *args: str) -> "QuerySetSingle[T_co]": ... # pragma: nocoverage - def annotate(self, **kwargs: Function) -> "QuerySetSingle[T_co]": - ... # pragma: nocoverage + def annotate(self, **kwargs: Function) -> "QuerySetSingle[T_co]": ... # pragma: nocoverage - def only(self, *fields_for_select: str) -> "QuerySetSingle[T_co]": - ... # pragma: nocoverage + def only(self, *fields_for_select: str) -> "QuerySetSingle[T_co]": ... # pragma: nocoverage - def values_list(self, *fields_: str, flat: bool = False) -> "ValuesListQuery[Literal[True]]": - ... # pragma: nocoverage + def values_list( + self, *fields_: str, flat: bool = False + ) -> "ValuesListQuery[Literal[True]]": ... # pragma: nocoverage - def values(self, *args: str, **kwargs: str) -> "ValuesQuery[Literal[True]]": - ... # pragma: nocoverage + def values( + self, *args: str, **kwargs: str + ) -> "ValuesQuery[Literal[True]]": ... # pragma: nocoverage class AwaitableQuery(Generic[MODEL]): - __slots__ = ("_joined_tables", "query", "model", "_db", "capabilities", "_annotations") + __slots__ = ( + "_joined_tables", + "query", + "model", + "_db", + "capabilities", + "_annotations", + ) def __init__(self, model: Type[MODEL]) -> None: self._joined_tables: List[Table] = [] @@ -912,7 +918,13 @@ def _join_table_with_select_related( table = self._join_table_by_field(table, field, field_object) related_fields = field_object.related_model._meta.db_fields - append_item = (field_object.related_model, len(related_fields), field, model, path) + append_item = ( + field_object.related_model, + len(related_fields), + field, + model, + path, + ) if append_item not in self._select_related_idx: self._select_related_idx.append(append_item) for related_field in related_fields: @@ -937,7 +949,13 @@ def _make_query(self) -> None: self._joined_tables = [] table = self.model._meta.basetable if self._fields_for_select: - append_item = (self.model, len(self._fields_for_select), table, self.model, (None,)) + append_item = ( + self.model, + len(self._fields_for_select), + table, + self.model, + (None,), + ) if append_item not in self._select_related_idx: self._select_related_idx.append(append_item) db_fields_for_select = [ @@ -1081,7 +1099,8 @@ def _make_query(self) -> None: fk_field: str = field_object.source_field # type: ignore db_field = self.model._meta.fields_map[fk_field].source_field value = executor.column_map[fk_field]( - getattr(value, field_object.to_field_instance.model_field_name), None + getattr(value, field_object.to_field_instance.model_field_name), + None, ) else: try: @@ -1143,7 +1162,10 @@ def _make_query(self) -> None: if self.capabilities.support_update_limit_order_by and self.limit: self.query._limit = self.limit self.resolve_ordering( - self.model, self.model._meta.basetable, self.orderings, self.annotations + model=self.model, + table=self.model._meta.basetable, + orderings=self.orderings, + annotations=self.annotations, ) self.resolve_filters( model=self.model, @@ -1285,7 +1307,6 @@ async def _execute(self) -> int: class FieldSelectQuery(AwaitableQuery): # pylint: disable=W0223 - __slots__ = ("annotations",) def __init__(self, model: Type[MODEL], annotations: Dict[str, Any]) -> None: super().__init__(model) @@ -1459,7 +1480,10 @@ def _make_query(self) -> None: self.add_field_to_select_query(field, positional_number) self.resolve_ordering( - self.model, self.model._meta.basetable, self.orderings, self.annotations + model=self.model, + table=self.model._meta.basetable, + orderings=self.orderings, + annotations=self.annotations, ) self.resolve_filters( model=self.model, @@ -1486,12 +1510,12 @@ def _make_query(self) -> None: @overload def __await__( self: "ValuesListQuery[Literal[False]]", - ) -> Generator[Any, None, List[Tuple[Any, ...]]]: - ... + ) -> Generator[Any, None, List[Tuple[Any, ...]]]: ... @overload - def __await__(self: "ValuesListQuery[Literal[True]]") -> Generator[Any, None, Tuple[Any, ...]]: - ... + def __await__( + self: "ValuesListQuery[Literal[True]]", + ) -> Generator[Any, None, Tuple[Any, ...]]: ... def __await__(self) -> Generator[Any, None, Union[List[Any], Tuple[Any, ...]]]: if self._db is None: @@ -1584,12 +1608,15 @@ def _make_query(self) -> None: self.add_field_to_select_query(field, return_as) self.resolve_ordering( - self.model, self.model._meta.basetable, self.orderings, self.annotations + model=self.model, + table=self.model._meta.basetable, + orderings=self.orderings, + annotations=self.annotations, ) self.resolve_filters( model=self.model, q_objects=self.q_objects, - annotations=self.annotations, + annotations=self._annotations, custom_filters=self.custom_filters, ) if self.limit: @@ -1611,14 +1638,16 @@ def _make_query(self) -> None: @overload def __await__( self: "ValuesQuery[Literal[False]]", - ) -> Generator[Any, None, List[Dict[str, Any]]]: - ... + ) -> Generator[Any, None, List[Dict[str, Any]]]: ... @overload - def __await__(self: "ValuesQuery[Literal[True]]") -> Generator[Any, None, Dict[str, Any]]: - ... + def __await__( + self: "ValuesQuery[Literal[True]]", + ) -> Generator[Any, None, Dict[str, Any]]: ... - def __await__(self) -> Generator[Any, None, Union[List[Dict[str, Any]], Dict[str, Any]]]: + def __await__( + self, + ) -> Generator[Any, None, Union[List[Dict[str, Any]], Dict[str, Any]]]: if self._db is None: self._db = self._choose_db() # type: ignore self._make_query() @@ -1696,7 +1725,16 @@ def __init__( fields: Iterable[str], batch_size: Optional[int] = None, ): - super().__init__(model, {}, db, q_objects, annotations, custom_filters, limit, orderings) + super().__init__( + model, + update_kwargs={}, + db=db, + q_objects=q_objects, + annotations=annotations, + custom_filters=custom_filters, + limit=limit, + orderings=orderings, + ) self.objects = objects self.fields = fields self.batch_size = batch_size @@ -1707,7 +1745,12 @@ def _make_query(self) -> None: self.query = self._db.query_class.update(table) if self.capabilities.support_update_limit_order_by and self.limit: self.query._limit = self.limit - self.resolve_ordering(self.model, table, self.orderings, self.annotations) + self.resolve_ordering( + model=self.model, + table=table, + orderings=self.orderings, + annotations=self.annotations, + ) self.resolve_filters( model=self.model, @@ -1728,14 +1771,16 @@ def _make_query(self) -> None: field_value = getattr(obj, field) case.when( pk == value, - Cast( - self.query._wrapper_cls(field_value), - obj._meta.fields_map[field].get_for_dialect( - self._db.schema_generator.DIALECT, "SQL_TYPE" - ), - ) - if self._db.schema_generator.DIALECT == "postgres" - else self.query._wrapper_cls(field_value), + ( + Cast( + self.query._wrapper_cls(field_value), + obj._meta.fields_map[field].get_for_dialect( + self._db.schema_generator.DIALECT, "SQL_TYPE" + ), + ) + if self._db.schema_generator.DIALECT == "postgres" + else self.query._wrapper_cls(field_value) + ), ) pk_list.append(value) query = query.set(field, case) @@ -1800,7 +1845,9 @@ def _make_query(self) -> None: include_generated=True ) self.insert_query_all = self.executor._prepare_insert_statement( - columns_all, has_generated=False, ignore_conflicts=self.ignore_conflicts + columns_all, + has_generated=False, + ignore_conflicts=self.ignore_conflicts, ) if self.update_fields: alias = f"new_{self.model._meta.db_table}"