Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 932 for _id (0.14 sec)

  1. tests/test_dependency_normal_exceptions.py

    
    @app.put("/invalid-user/{user_id}")
    def put_invalid_user(
        user_id: str, name: str = Body(), db: dict = Depends(get_database)
    ):
        db[user_id] = name
        raise HTTPException(status_code=400, detail="Invalid user")
    
    
    @app.put("/user/{user_id}")
    def put_user(user_id: str, name: str = Body(), db: dict = Depends(get_database)):
        db[user_id] = name
        return {"message": "OK"}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. docs_src/sql_databases/sql_app/crud.py

    def get_items(db: Session, skip: int = 0, limit: int = 100):
        return db.query(models.Item).offset(skip).limit(limit).all()
    
    
    def create_user_item(db: Session, item: schemas.ItemCreate, user_id: int):
        db_item = models.Item(**item.dict(), owner_id=user_id)
        db.add(db_item)
        db.commit()
        db.refresh(db_item)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 1K bytes
    - Viewed (0)
  3. docs_src/sql_databases/sql_app_py39/alt_main.py

        return users
    
    
    @app.get("/users/{user_id}", response_model=schemas.User)
    def read_user(user_id: int, db: Session = Depends(get_db)):
        db_user = crud.get_user(db, user_id=user_id)
        if db_user is None:
            raise HTTPException(status_code=404, detail="User not found")
        return db_user
    
    
    @app.post("/users/{user_id}/items/", response_model=schemas.Item)
    def create_item_for_user(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb/MIEName.java

         */
        MIEName ( byte[] buf ) {
            int i;
            int len;
            if ( buf.length < TOK_ID_SIZE + MECH_OID_LEN_SIZE ) {
                throw new IllegalArgumentException();
            }
            // TOK_ID
            for ( i = 0; i < TOK_ID.length; i++ ) {
                if ( TOK_ID[ i ] != buf[ i ] ) {
                    throw new IllegalArgumentException();
                }
            }
            // MECH_OID_LEN
    Java
    - Registered: Sun Apr 28 00:10:09 GMT 2024
    - Last Modified: Sun Jul 01 13:12:10 GMT 2018
    - 3.5K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/test/cthread_windows.c

    doAdd(int max, int nthread)
    {
    	enum { MaxThread = 20 };
    	int i;
    	uintptr_t thread_id[MaxThread];
    	
    	if(nthread > MaxThread)
    		nthread = MaxThread;
    	for(i=0; i<nthread; i++)
    		thread_id[i] = _beginthreadex(0, 0, addThread, &max, 0, 0);
    	for(i=0; i<nthread; i++) {
    		WaitForSingleObject((HANDLE)thread_id[i], INFINITE);
    		CloseHandle((HANDLE)thread_id[i]);
    	}
    }
    
    __stdcall
    static unsigned int
    goDummyCallbackThread(void* p)
    C
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed May 17 21:53:11 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  6. docs_src/path_params_numeric_validations/tutorial002_an.py

    from fastapi import FastAPI, Path
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        q: str, item_id: Annotated[int, Path(title="The ID of the item to get")]
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 321 bytes
    - Viewed (0)
  7. docs_src/query_params/tutorial006.py

    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_user_item(
        item_id: str, needy: str, skip: int = 0, limit: Union[int, None] = None
    ):
        item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 301 bytes
    - Viewed (0)
  8. docs_src/schema_extra_example/tutorial005.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item = Body(
            openapi_examples={
                "normal": {
                    "summary": "A normal example",
                    "description": "A **normal** item works correctly.",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  9. docs_src/path_params_numeric_validations/tutorial004_an.py

    from fastapi import FastAPI, Path
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        item_id: Annotated[int, Path(title="The ID of the item to get", ge=1)], q: str
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 327 bytes
    - Viewed (0)
  10. docs_src/path_params_numeric_validations/tutorial005_an.py

    from fastapi import FastAPI, Path
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        item_id: Annotated[int, Path(title="The ID of the item to get", gt=0, le=1000)],
        q: str,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 341 bytes
    - Viewed (0)
Back to top