- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 38 for elseif (0.22 sec)
-
fastapi/utils.py
field_info = field_info or FieldInfo( annotation=type_, default=default, alias=alias ) else: field_info = field_info or FieldInfo() kwargs = {"name": name, "field_info": field_info} if PYDANTIC_V2: kwargs.update({"mode": mode}) else: kwargs.update( { "type_": type_, "class_validators": class_validators,
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.8K bytes - Viewed (0) -
tests/test_validate_response.py
def get_invalid_none(): return None @app.get("/items/validnone", response_model=Union[Item, None]) def get_valid_none(send_none: bool = False): if send_none: return None else: return {"name": "invalid", "price": 3.2} @app.get("/items/innerinvalid", response_model=Item) def get_innerinvalid(): return {"name": "double invalid", "price": "foo", "owner_ids": ["foo", "bar"]}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 2K bytes - Viewed (0) -
tests/test_additional_properties_bool.py
from fastapi.testclient import TestClient from pydantic import BaseModel, ConfigDict class FooBaseModel(BaseModel): if PYDANTIC_V2: model_config = ConfigDict(extra="forbid") else: class Config: extra = "forbid" class Foo(FooBaseModel): pass app = FastAPI() @app.post("/") async def post( foo: Union[Foo, None] = None, ):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 4.2K bytes - Viewed (0) -
docs_src/security/tutorial004.py
return user def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.now(timezone.utc) + expires_delta else: expire = datetime.now(timezone.utc) + timedelta(minutes=15) to_encode.update({"exp": expire}) encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM) return encoded_jwt
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4K bytes - Viewed (0) -
docs_src/security/tutorial004_an.py
return user def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.now(timezone.utc) + expires_delta else: expire = datetime.now(timezone.utc) + timedelta(minutes=15) to_encode.update({"exp": expire}) encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM) return encoded_jwt
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4.1K bytes - Viewed (0) -
docs/en/docs/tutorial/security/get-current-user.md
But that is still not that useful. Let's make it give us the current user. ## Create a user model First, let's create a Pydantic user model. The same way we use Pydantic to declare bodies, we can use it anywhere else: === "Python 3.10+" ```Python hl_lines="5 12-16" {!> ../../../docs_src/security/tutorial002_an_py310.py!} ``` === "Python 3.9+" ```Python hl_lines="5 12-16"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 7.6K bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial014_an_py39.py
@app.get("/items/") async def read_items( hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None, ): if hidden_query: return {"hidden_query": hidden_query} else:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 344 bytes - Viewed (0) -
docs_src/security/tutorial005_an.py
return user def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None): to_encode = data.copy() if expires_delta: expire = datetime.now(timezone.utc) + expires_delta else: expire = datetime.now(timezone.utc) + timedelta(minutes=15) to_encode.update({"exp": expire}) encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM) return encoded_jwt
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 5.3K bytes - Viewed (0) -
docs_src/security/tutorial004_an_py310.py
return user def create_access_token(data: dict, expires_delta: timedelta | None = None): to_encode = data.copy() if expires_delta: expire = datetime.now(timezone.utc) + expires_delta else: expire = datetime.now(timezone.utc) + timedelta(minutes=15) to_encode.update({"exp": expire}) encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM) return encoded_jwt
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4.1K bytes - Viewed (0) -
docs/en/layouts/custom.yml
{%- endif -%} # Font family (default: Roboto) - &font_family >- {%- if layout.font_family -%} {{ layout.font_family }} {%- elif config.theme.font != false -%} {{ config.theme.font.get("text", "Roboto") }} {%- else -%} Roboto {%- endif -%} # Site name - &site_name >- {{ config.site_name }} # Page title - &page_title >-
Others - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Jun 26 14:05:43 GMT 2023 - 6.5K bytes - Viewed (0)