- Sort Score
- Num 10 results
- Language All
Results 81 - 90 of 284 for unionOf (0.04 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs_src/request_files/tutorial001_02_py39.py
from typing import Union from fastapi import FastAPI, File, UploadFile app = FastAPI() @app.post("/files/") async def create_file(file: Union[bytes, None] = File(default=None)): if not file: return {"message": "No file sent"} else: return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file(file: Union[UploadFile, None] = None): if not file:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 508 bytes - Click Count (0) -
fastapi/_compat/v2.py
name: str mode: Literal["validation", "serialization"] = "validation" config: Union[ConfigDict, None] = None @property def alias(self) -> str: a = self.field_info.alias return a if a is not None else self.name @property def validation_alias(self) -> Union[str, None]: va = self.field_info.validation_alias if isinstance(va, str) and va:Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 19.1K bytes - Click Count (0) -
docs_src/sql_databases/tutorial001_an_py39.py
from typing import Annotated, Union from fastapi import Depends, FastAPI, HTTPException, Query from sqlmodel import Field, Session, SQLModel, create_engine, select class Hero(SQLModel, table=True): id: Union[int, None] = Field(default=None, primary_key=True) name: str = Field(index=True) age: Union[int, None] = Field(default=None, index=True) secret_name: str sqlite_file_name = "database.db"
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Oct 09 19:44:42 GMT 2024 - 1.7K bytes - Click Count (0) -
docs_src/security/tutorial005_an_py39.py
class Token(BaseModel): access_token: str token_type: str class TokenData(BaseModel): username: Union[str, None] = None scopes: list[str] = [] class User(BaseModel): username: str email: Union[str, None] = None full_name: Union[str, None] = None disabled: Union[bool, None] = None class UserInDB(User): hashed_password: str
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Mon Sep 29 02:57:38 GMT 2025 - 5.3K bytes - Click Count (0) -
docs_src/path_operation_configuration/tutorial004_py39.py
from typing import Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: set[str] = set() @app.post("/items/", response_model=Item, summary="Create an item") async def create_item(item: Item): """ Create an item with all the information:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 676 bytes - Click Count (0) -
docs_src/python_types/tutorial008b_py39.py
from typing import Union def process_item(item: Union[int, str]):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 84 bytes - Click Count (0) -
docs/ru/docs/python-types.md
``` //// #### Использовать `Union` или `Optional` { #using-union-or-optional } Если вы используете версию Python ниже 3.10, вот совет с моей весьма **субъективной** точки зрения: * 🚨 Избегайте использования `Optional[SomeType]` * Вместо этого ✨ **используйте `Union[SomeType, None]`** ✨.Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 24.4K bytes - Click Count (0) -
docs/de/docs/python-types.md
#### <abbr title="Union – Verbund, Einheit‚ Vereinigung: Eines von Mehreren">Union</abbr> { #union } Sie können deklarieren, dass eine Variable einer von **verschiedenen Typen** sein kann, zum Beispiel ein `int` oder ein `str`. In Python 3.6 und höher (inklusive Python 3.10) können Sie den `Union`-Typ von `typing` verwenden und die möglichen Typen innerhalb der eckigen Klammern auflisten.
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 17.9K bytes - Click Count (1) -
docs_src/dataclasses_/tutorial001_py39.py
from dataclasses import dataclass from typing import Union from fastapi import FastAPI @dataclass class Item: name: str price: float description: Union[str, None] = None tax: Union[float, None] = None app = FastAPI() @app.post("/items/") async def create_item(item: Item):Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 312 bytes - Click Count (0) -
docs_src/cookie_param_models/tutorial002_py39.py
from typing import Union from fastapi import Cookie, FastAPI from pydantic import BaseModel app = FastAPI() class Cookies(BaseModel): model_config = {"extra": "forbid"} session_id: str fatebook_tracker: Union[str, None] = None googall_tracker: Union[str, None] = None @app.get("/items/") async def read_items(cookies: Cookies = Cookie()):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 381 bytes - Click Count (0)