- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for age (0.23 sec)
-
tests/test_union_inherited_body.py
class Item(BaseModel): name: Optional[str] = None class ExtendedItem(Item): age: int @app.post("/items/") def save_union_different_body(item: Union[ExtendedItem, Item]): return {"item": item} client = TestClient(app) def test_post_extended_item(): response = client.post("/items/", json={"name": "Foo", "age": 5}) assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 5.2K bytes - Viewed (0) -
docs_src/graphql/tutorial001.py
import strawberry from fastapi import FastAPI from strawberry.asgi import GraphQL @strawberry.type class User: name: str age: int @strawberry.type class Query: @strawberry.field def user(self) -> User: return User(name="Patrick", age=100) schema = strawberry.Schema(query=Query) graphql_app = GraphQL(schema) app = FastAPI() app.add_route("/graphql", graphql_app)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Oct 03 18:00:28 GMT 2021 - 446 bytes - Viewed (0) -
tests/test_response_model_include_exclude.py
from pydantic import BaseModel class Model1(BaseModel): foo: str bar: str class Model2(BaseModel): ref: Model1 baz: str class Model3(BaseModel): name: str age: int ref2: Model2 app = FastAPI() @app.get( "/simple_include", response_model=Model2, response_model_include={"baz": ..., "ref": {"foo"}}, ) def simple_include():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Jul 19 19:14:58 GMT 2021 - 4K bytes - Viewed (0) -
docs_src/python_types/tutorial003.py
def get_name_with_age(name: str, age: int): name_with_age = name + " is this old: " + age
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 119 bytes - Viewed (0) -
tests/test_multi_body_errors.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.6K bytes - Viewed (0) -
docs_src/python_types/tutorial004.py
def get_name_with_age(name: str, age: int): name_with_age = name + " is this old: " + str(age)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 124 bytes - Viewed (0) -
docs_src/python_types/tutorial012.py
from typing import Optional from pydantic import BaseModel class User(BaseModel): name: str
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 122 bytes - Viewed (0)