Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 48 for or (0.15 sec)

  1. docs_src/dependencies/tutorial005_an_py39.py

        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    async def read_query(
        query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
    ):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 529 bytes
    - Viewed (0)
  2. docs_src/security/tutorial005_an_py310.py

    ) -> Token:
        user = authenticate_user(fake_users_db, form_data.username, form_data.password)
        if not user:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
        access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
        access_token = create_access_token(
            data={"sub": user.username, "scopes": form_data.scopes},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  3. docs_src/security/tutorial005_py310.py

    ) -> Token:
        user = authenticate_user(fake_users_db, form_data.username, form_data.password)
        if not user:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
        access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)
        access_token = create_access_token(
            data={"sub": user.username, "scopes": form_data.scopes},
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial005_an_py310.py

        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[str | None, Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    async def read_query(
        query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
    ):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 510 bytes
    - Viewed (0)
  5. fastapi/_compat.py

        return (
            _annotation_is_complex(annotation)
            or _annotation_is_complex(origin)
            or hasattr(origin, "__pydantic_core_schema__")
            or hasattr(origin, "__get_pydantic_core_schema__")
        )
    
    
    def field_annotation_is_scalar(annotation: Any) -> bool:
        # handle Ellipsis here to make tuple[int, ...] work nicely
        return annotation is Ellipsis or not field_annotation_is_complex(annotation)
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  6. configure.py

          question=question,
          yes_reply=yes_reply,
          no_reply=no_reply,
          bazel_config_name='download_clang')
    
    
    def get_from_env_or_user_or_default(environ_cp, var_name, ask_for_var,
                                        var_default):
      """Get var_name either from env, or user or default.
    
      If var_name has been set as environment variable, use the preset value, else
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 18:25:36 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  7. fastapi/encoders.py

            for key, value in obj.items():
                if (
                    (
                        not sqlalchemy_safe
                        or (not isinstance(key, str))
                        or (not key.startswith("_sa"))
                    )
                    and (value is not None or not exclude_none)
                    and key in allowed_keys
                ):
                    encoded_key = jsonable_encoder(
                        key,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  8. fastapi/security/open_id_connect_url.py

                    provided in one of multiple optional ways (for example, with OpenID
                    Connect or in a cookie).
                    """
                ),
            ] = True,
        ):
            self.model = OpenIdConnectModel(
                openIdConnectUrl=openIdConnectUrl, description=description
            )
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  9. tests/test_path.py

            {
                "detail": [
                    {
                        "type": "greater_than_equal",
                        "loc": ["path", "item_id"],
                        "msg": "Input should be greater than or equal to 3",
                        "input": "2",
                        "ctx": {"ge": 3.0},
                    }
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 34.4K bytes
    - Viewed (0)
  10. fastapi/param_functions.py

                allowed by the alias or set of aliases defined.
                """
            ),
        ] = None,
        serialization_alias: Annotated[
            Union[str, None],
            Doc(
                """
                'Blacklist' validation step. The vanilla parameter field will be the
                single one of the alias' or set of aliases' fields and all the other
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
Back to top