Skip to content

Commit 5e04679

Browse files
committed
🔧 Update GitHub question template with newest syntax in Python 3.10, no Optional
1 parent 0e5e197 commit 5e04679

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎.github/DISCUSSION_TEMPLATE/questions.yml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,14 @@ body:
6464
If I (or someone) can copy it, run it, and see it right away, there's a much higher chance I (or someone) will be able to help you.
6565
6666
placeholder: |
67-
from typing import Optional
68-
6967
from sqlmodel import Field, Session, SQLModel, create_engine
7068
7169
7270
class Hero(SQLModel, table=True):
73-
id: Optional[int] = Field(default=None, primary_key=True)
71+
id: int | None = Field(default=None, primary_key=True)
7472
name: str
7573
secret_name: str
76-
age: Optional[int] = None
74+
age: int | None = None
7775
7876
7977
hero_1 = Hero(name="Deadpond", secret_name="Dive Wilson")
@@ -87,7 +85,7 @@ body:
8785
session.add(hero_1)
8886
session.commit()
8987
session.refresh(hero_1)
90-
print(hero_1)
88+
print(hero_1)\
9189
render: python
9290
validations:
9391
required: true

0 commit comments

Comments
 (0)