Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 1,072 for Str (0.04 sec)

  1. docs_src/background_tasks/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import BackgroundTasks, Depends, FastAPI
    
    app = FastAPI()
    
    
    def write_log(message: str):
        with open("log.txt", mode="a") as log:
            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None):
        if q:
            message = f"found query: {q}\n"
            background_tasks.add_task(write_log, message)
        return q
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 696 bytes
    - Viewed (0)
  2. docs_src/additional_responses/tutorial003.py

    from fastapi import FastAPI
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    class Message(BaseModel):
        message: str
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={
            404: {"model": Message, "description": "The item was not found"},
            200: {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 837 bytes
    - Viewed (0)
  3. docs_src/background_tasks/tutorial002_an.py

    from fastapi import BackgroundTasks, Depends, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    def write_log(message: str):
        with open("log.txt", mode="a") as log:
            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None):
        if q:
            message = f"found query: {q}\n"
            background_tasks.add_task(write_log, message)
        return q
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 725 bytes
    - Viewed (0)
  4. docs_src/security/tutorial002_an_py39.py

    
    class User(BaseModel):
        username: str
        email: Union[str, None] = None
        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    def fake_decode_token(token):
        return User(
            username=token + "fakedecoded", email="******@****.***", full_name="John Doe"
        )
    
    
    async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
        user = fake_decode_token(token)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 786 bytes
    - Viewed (0)
  5. docs_src/response_model/tutorial005_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float = 10.5
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2},
        "baz": {
            "name": "Baz",
            "description": "There goes my baz",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 816 bytes
    - Viewed (0)
  6. src/test/java/jcifs/tests/NamingTest.java

                }
                buf.put((byte) i);
            }
            buf.flip();
            String str = cs.decode(buf).toString();
            return str;
        }
    
    
        private static String[] splitString ( String str, int maxLen ) {
            int num = str.length() / maxLen;
            if ( str.length() % maxLen != 0 ) {
                num++;
            }
            String strings[] = new String[num];
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Sat Jun 06 10:48:05 UTC 2020
    - 7K bytes
    - Viewed (0)
  7. docs/ko/docs/tutorial/extra-data-types.md

        * 요청과 응답에서 `2008-09-15T15:53:00+05:00`와 같은 ISO 8601 형식의 `str`로 표현됩니다.
    * `datetime.date`:
        * 파이썬의 `datetime.date`.
        * 요청과 응답에서 `2008-09-15`와 같은 ISO 8601 형식의 `str`로 표현됩니다.
    * `datetime.time`:
        * 파이썬의 `datetime.time`.
        * 요청과 응답에서 `14:23:55.003`와 같은 ISO 8601 형식의 `str`로 표현됩니다.
    * `datetime.timedelta`:
        * 파이썬의 `datetime.timedelta`.
        * 요청과 응답에서 전체 초(seconds)의 `float`로 표현됩니다.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  8. docs/zh/docs/tutorial/extra-data-types.md

    到目前为止,您一直在使用常见的数据类型,如:
    
    * `int`
    * `float`
    * `str`
    * `bool`
    
    但是您也可以使用更复杂的数据类型。
    
    您仍然会拥有现在已经看到的相同的特性:
    
    * 很棒的编辑器支持。
    * 传入请求的数据转换。
    * 响应数据转换。
    * 数据验证。
    * 自动补全和文档。
    
    ## 其他数据类型
    
    下面是一些你可以使用的其他数据类型:
    
    * `UUID`:
        * 一种标准的 "通用唯一标识符" ,在许多数据库和系统中用作ID。
        * 在请求和响应中将以 `str` 表示。
    * `datetime.datetime`:
        * 一个 Python `datetime.datetime`.
        * 在请求和响应中将表示为 ISO 8601 格式的 `str` ,比如: `2008-09-15T15:53:00+05:00`.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  9. docs_src/sql_databases/tutorial002_py310.py

    
    class HeroBase(SQLModel):
        name: str = Field(index=True)
        age: int | None = Field(default=None, index=True)
    
    
    class Hero(HeroBase, table=True):
        id: int | None = Field(default=None, primary_key=True)
        secret_name: str
    
    
    class HeroPublic(HeroBase):
        id: int
    
    
    class HeroCreate(HeroBase):
        secret_name: str
    
    
    class HeroUpdate(HeroBase):
        name: str | None = None
        age: int | None = None
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb1/dcerpc/DcerpcHandle.java

         * proto:ts0.win.net[\pipe\srvsvc]
         *
         * If the server is absent it is set to "127.0.0.1"
         */ 
        protected static DcerpcBinding parseBinding(String str) throws DcerpcException {
            int state, mark, si;
            char[] arr = str.toCharArray();
            String proto = null, key = null;
            DcerpcBinding binding = null;
    
            state = mark = si = 0;
            do {
                char ch = arr[si];
    
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Fri Mar 22 21:10:40 UTC 2019
    - 8.8K bytes
    - Viewed (0)
Back to top