]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
🔥 Remove outdated Python 3.9 tutorial file (#1822)
authorSofie Van Landeghem <svlandeg@users.noreply.github.com>
Wed, 25 Mar 2026 07:30:50 +0000 (08:30 +0100)
committerGitHub <noreply@github.com>
Wed, 25 Mar 2026 07:30:50 +0000 (08:30 +0100)
* cleanup

* delete file

---------

Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
docs_src/tutorial/where/tutorial006b_py39.py [deleted file]
tests/test_tutorial/test_where/test_tutorial006b.py

diff --git a/docs_src/tutorial/where/tutorial006b_py39.py b/docs_src/tutorial/where/tutorial006b_py39.py
deleted file mode 100644 (file)
index deb0b23..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-from typing import Optional
-
-from sqlmodel import Field, Session, SQLModel, col, create_engine, select
-
-
-class Hero(SQLModel, table=True):
-    id: Optional[int] = Field(default=None, primary_key=True)
-    name: str
-    secret_name: str
-    age: Optional[int] = None
-
-
-sqlite_file_name = "database.db"
-sqlite_url = f"sqlite:///{sqlite_file_name}"
-
-engine = create_engine(sqlite_url, echo=True)
-
-
-def create_db_and_tables():
-    SQLModel.metadata.create_all(engine)
-
-
-def create_heroes():
-    hero_1 = Hero(name="Deadpond", secret_name="Dive Wilson")
-    hero_2 = Hero(name="Spider-Boy", secret_name="Pedro Parqueador")
-    hero_3 = Hero(name="Rusty-Man", secret_name="Tommy Sharp", age=48)
-    hero_4 = Hero(name="Tarantula", secret_name="Natalia Roman-on", age=32)
-    hero_5 = Hero(name="Black Lion", secret_name="Trevor Challa", age=35)
-    hero_6 = Hero(name="Dr. Weird", secret_name="Steve Weird", age=36)
-    hero_7 = Hero(name="Captain North America", secret_name="Esteban Rogelios", age=93)
-
-    with Session(engine) as session:
-        session.add(hero_1)
-        session.add(hero_2)
-        session.add(hero_3)
-        session.add(hero_4)
-        session.add(hero_5)
-        session.add(hero_6)
-        session.add(hero_7)
-
-        session.commit()
-
-
-def select_heroes():
-    with Session(engine) as session:
-        statement = select(Hero).where(col(Hero.name).in_(["Deadpond", "Ratman"]))
-        results = session.exec(statement)
-        for hero in results:
-            print(hero)
-
-
-def main():
-    create_db_and_tables()
-    create_heroes()
-    select_heroes()
-
-
-if __name__ == "__main__":
-    main()
index 237618afea568a8ac61e9daf1d572515a2e8879c..6dbcb38a117b395109e7b902e90c787c6f6891f5 100644 (file)
@@ -10,7 +10,6 @@ from ...conftest import PrintMock, needs_py310
 @pytest.fixture(
     name="mod",
     params=[
-        pytest.param("tutorial006b_py39"),
         pytest.param("tutorial006b_py310", marks=needs_py310),
     ],
 )