mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 21:45:25 +02:00
prs-fleshgolem-2070: feat: sqlalchemy 2.0 (#2096)
* upgrade sqlalchemy to 2.0 * rewrite all db models to sqla 2.0 mapping api * fix some importing and typing weirdness * fix types of a lot of nullable columns * remove get_ref methods * fix issues found by tests * rewrite all queries in repository_recipe to 2.0 style * rewrite all repository queries to 2.0 api * rewrite all remaining queries to 2.0 api * remove now-unneeded __allow_unmapped__ flag * remove and fix some unneeded cases of "# type: ignore" * fix formatting * bump black version * run black * can this please be the last one. okay. just. okay. * fix repository errors * remove return * drop open API validator --------- Co-authored-by: Sören Busch <fleshgolem@gmx.net>
This commit is contained in:
parent
91cd00976a
commit
9e77a9f367
86 changed files with 1776 additions and 1572 deletions
|
@ -25,7 +25,6 @@ def get_path_objects(app: FastAPI):
|
|||
for key, value in app.openapi().items():
|
||||
if key == "paths":
|
||||
for key, value in value.items():
|
||||
|
||||
paths.append(
|
||||
PathObject(
|
||||
route_object=RouteObject(key),
|
||||
|
@ -50,7 +49,6 @@ def read_template(file: Path):
|
|||
|
||||
|
||||
def generate_python_templates(static_paths: list[PathObject], function_paths: list[PathObject]):
|
||||
|
||||
template = Template(read_template(CodeTemplates.pytest_routes))
|
||||
content = template.render(
|
||||
paths={
|
||||
|
|
|
@ -79,14 +79,12 @@ def find_modules(root: pathlib.Path) -> list[Modules]:
|
|||
modules: list[Modules] = []
|
||||
for file in root.iterdir():
|
||||
if file.is_dir() and file.name not in SKIP:
|
||||
|
||||
modules.append(Modules(directory=file))
|
||||
|
||||
return modules
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
modules = find_modules(SCHEMA_PATH)
|
||||
|
||||
for module in modules:
|
||||
|
|
|
@ -232,7 +232,6 @@ def recipe_data(name: str, slug: str, id: str, userId: str, groupId: str) -> dic
|
|||
|
||||
|
||||
def login(username="changeme@email.com", password="MyPassword"):
|
||||
|
||||
payload = {"username": username, "password": password}
|
||||
r = requests.post("http://localhost:9000/api/auth/token", payload)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue