Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for age (0.23 sec)

  1. 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)
  2. 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)
  3. docs/ru/docs/python-types.md

    ```
    
    Поскольку редактор знает типы переменных, вы получаете не только дополнение, но и проверки ошибок:
    
    <img src="/img/python-types/image04.png">
    
    Теперь вы знаете, что вам нужно исправить, преобразовав `age` в строку с `str(age)`:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Объявление типов
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  4. docs/uk/docs/python-types.md

    Оскільки редактор знає типи змінних, ви не тільки отримаєте автозаповнення, ви також отримаєте перевірку помилок:
    
    <img src="/img/python-types/image04.png">
    
    Тепер ви знаєте, щоб виправити це, вам потрібно перетворити `age` у строку з допомогою `str(age)`:
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial004.py!}
    ```
    
    ## Оголошення типів
    
    Щойно ви побачили основне місце для оголошення анотацій типу. Як параметри функції.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  5. 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)
  6. docs/zh/docs/tutorial/cors.md

    * `allow_credentials` - 指示跨域请求支持 cookies。默认是 `False`。另外,允许凭证时 `allow_origins` 不能设定为 `['*']`,必须指定源。
    * `expose_headers` - 指示可以被浏览器访问的响应头。默认为 `[]`。
    * `max_age` - 设定浏览器缓存 CORS 响应的最长时间,单位是秒。默认为 `600`。
    
    中间件响应两种特定类型的 HTTP 请求……
    
    ### CORS 预检请求
    
    这是些带有 `Origin` 和 `Access-Control-Request-Method` 请求头的 `OPTIONS` 请求。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 27 17:28:07 GMT 2021
    - 4.5K bytes
    - Viewed (0)
  7. docs/ko/docs/tutorial/cors.md

    * `allow_credentials` - 교차-출처 요청시 쿠키 지원 여부를 설정합니다. 기본값은 `False` 입니다. 또한 해당 항목을 허용할 경우 `allow_origins` 는 `['*']` 로 설정할 수 없으며, 출처를 반드시 특정해야 합니다.
    * `expose_headers` - 브라우저에 접근할 수 있어야 하는 모든 응답 헤더를 가리킵니다. 기본값은 `[]` 입니다.
    * `max_age` - 브라우저가 CORS 응답을 캐시에 저장하는 최대 시간을 초 단위로 설정합니다. 기본값은 `600` 입니다.
    
    미들웨어는 두가지 특정한 종류의 HTTP 요청에 응답합니다...
    
    ### CORS 사전 요청
    
    `Origin` 및 `Access-Control-Request-Method` 헤더와 함께 전송하는 모든 `OPTIONS` 요청입니다.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 07 14:21:23 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  8. 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)
  9. docs/ja/docs/tutorial/cors.md

    * `allow_credentials` - オリジン間リクエストでCookieをサポートする必要があることを示します。デフォルトは `False` です。
    * `expose_headers` - ブラウザからアクセスできるようにするレスポンスヘッダーを示します。デフォルトは `[]` です。
    * `max_age` - ブラウザがCORSレスポンスをキャッシュする最大時間を秒単位で設定します。デフォルトは `600` です。
    
    このミドルウェアは2種類のHTTPリクエストに応答します...
    
    ### CORSプリフライトリクエスト
    
    これらは、 `Origin` ヘッダーと `Access-Control-Request-Method` ヘッダーを持つ `OPTIONS` リクエストです。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Oct 18 06:02:19 GMT 2020
    - 6.3K bytes
    - Viewed (0)
  10. 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)
Back to top