- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 575 for same (0.19 sec)
-
docs_src/sql_databases_peewee/sql_app/database.py
def __getattr__(self, name): return self._state.get()[name] db = peewee.SqliteDatabase(DATABASE_NAME, check_same_thread=False)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 662 bytes - Viewed (0) -
docs_src/sql_databases/sql_app_py310/database.py
SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db" # SQLALCHEMY_DATABASE_URL = "postgresql://user:password@postgresserver/db" engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False} ) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 461 bytes - Viewed (0) -
fastapi/security/oauth2.py
), ] = True, ): self.model = OAuth2Model( flows=cast(OAuthFlowsModel, flows), description=description ) self.scheme_name = scheme_name or self.__class__.__name__ self.auto_error = auto_error async def __call__(self, request: Request) -> Optional[str]: authorization = request.headers.get("Authorization") if not authorization:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Apr 02 02:48:51 GMT 2024 - 21.1K bytes - Viewed (1) -
fastapi/param_functions.py
), ] = _Unset, alias: Annotated[ Optional[str], Doc( """ An alternative name for the parameter field. This will be used to extract the data and for the generated OpenAPI. It is particularly useful when you can't use the name you want because it is a Python reserved keyword or similar. """ ), ] = None,
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 62.5K bytes - Viewed (0) -
docs_src/sql_databases/sql_app_py39/tests/test_sql_app.py
from sqlalchemy.orm import sessionmaker from ..database import Base from ..main import app, get_db SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db" engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False} ) TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) Base.metadata.create_all(bind=engine) def override_get_db(): try:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 1.2K bytes - Viewed (0) -
tests/test_dependency_contextvars.py
def test_dependency_contextvars(): """ Check that custom middlewares don't affect the contextvar context for dependencies. The code before yield and the code after yield should be run in the same contextvar context, so that request_state_context_var.reset(contextvar_token). If they are run in a different context, that raises an error. """ response = client.get("/user")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Feb 17 12:40:12 GMT 2022 - 1.5K bytes - Viewed (0) -
docs_src/path_operation_advanced_configuration/tutorial007.py
from typing import List import yaml from fastapi import FastAPI, HTTPException, Request from pydantic import BaseModel, ValidationError app = FastAPI() class Item(BaseModel): name: str tags: List[str] @app.post( "/items/", openapi_extra={ "requestBody": { "content": {"application/x-yaml": {"schema": Item.model_json_schema()}}, "required": True, }, },
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 822 bytes - Viewed (0) -
tests/test_serialize_response.py
def get_validlist(): return [ {"name": "foo"}, {"name": "bar", "price": 1.0}, {"name": "baz", "price": 2.0, "owner_ids": [1, 2, 3]}, ] client = TestClient(app) def test_valid(): response = client.get("/items/valid") response.raise_for_status() assert response.json() == {"name": "valid", "price": 1.0, "owner_ids": None} def test_coerce():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Mon Aug 03 12:29:07 GMT 2020 - 1.4K bytes - Viewed (0) -
tests/test_tutorial/test_body/test_tutorial001_py310.py
"tax": None, } @needs_py310 def test_post_with_str_float_description_tax(client: TestClient): response = client.post( "/items/", json={"name": "Foo", "price": "50.5", "description": "Some Foo", "tax": 0.3}, ) assert response.status_code == 200 assert response.json() == { "name": "Foo", "price": 50.5, "description": "Some Foo",
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 15K bytes - Viewed (2) -
tests/test_tutorial/test_body/test_tutorial001.py
"tax": None, } def test_post_with_str_float_description_tax(client: TestClient): response = client.post( "/items/", json={"name": "Foo", "price": "50.5", "description": "Some Foo", "tax": 0.3}, ) assert response.status_code == 200 assert response.json() == { "name": "Foo", "price": 50.5, "description": "Some Foo", "tax": 0.3,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 14.7K bytes - Viewed (7)