Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,183 for USER (0.02 sec)

  1. docs/ja/docs/tutorial/security/get-current-user.md

    ## ユーザーの取得
    
    `get_current_user` は作成した(偽物の)ユーティリティ関数を使って、 `str` としてトークンを受け取り、先ほどのPydanticの `User` モデルを返却します:
    
    {* ../../docs_src/security/tutorial002.py hl[19:22,26:27] *}
    
    ## 現在のユーザーの注入
    
    ですので、 `get_current_user` に対して同様に *path operation* の中で `Depends` を利用できます。
    
    {* ../../docs_src/security/tutorial002.py hl[31] *}
    
    Pydanticモデルの `User` として、 `current_user` の型を宣言することに注意してください。
    
    その関数の中ですべての入力補完や型チェックを行う際に役に立ちます。
    
    /// tip | 豆知識
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/security/get-current-user.md

    # Get Current User { #get-current-user }
    
    In the previous chapter the security system (which is based on the dependency injection system) was giving the *path operation function* a `token` as a `str`:
    
    {* ../../docs_src/security/tutorial001_an_py39.py hl[12] *}
    
    But that is still not that useful.
    
    Let's make it give us the current user.
    
    ## Create a user model { #create-a-user-model }
    
    First, let's create a Pydantic user model.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 4K bytes
    - Viewed (0)
  3. docs/de/docs/tutorial/security/get-current-user.md

    {* ../../docs_src/security/tutorial002_an_py310.py hl[25] *}
    
    ## Den Benutzer holen
    
    `get_current_user` wird eine von uns erstellte (gefakte) Hilfsfunktion verwenden, welche einen Token vom Typ `str` entgegennimmt und unser Pydantic-`User`-Modell zurückgibt:
    
    {* ../../docs_src/security/tutorial002_an_py310.py hl[19:22,26:27] *}
    
    ## Den aktuellen Benutzer einfügen
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  4. docs/pt/docs/tutorial/security/get-current-user.md

    Isso nos ajudará dentro da função com...
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Fri Jan 10 13:33:35 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/security/get-current-user.md

    ## 유저 가져오기
    
    `get_current_user`는 토큰을 `str`로 취하고 Pydantic `User` 모델을 반환하는 우리가 만든 (가짜) 유틸리티 함수를 사용합니다.
    
    {* ../../docs_src/security/tutorial002.py hl[19:22,26:27] *}
    
    ## 현재 유저 주입하기
    
    이제 *경로 작동*에서 `get_current_user`와 동일한 `Depends`를 사용할 수 있습니다.
    
    {* ../../docs_src/security/tutorial002.py hl[31] *}
    
    Pydantic 모델인 `User`로 `current_user`의 타입을 선언하는 것을 알아야 합니다.
    
    이것은 모든 완료 및 타입 검사를 통해 함수 내부에서 우리를 도울 것입니다.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  6. tests/joins_test.go

    		return user.Pets[i].ID > user.Pets[j].ID
    	})
    
    	if len(results) != 2 || results[0].Name != user.Pets[0].Name || results[1].Name != user.Pets[1].Name {
    		t.Errorf("Should find all two pets with Join select, got %+v", results)
    	}
    }
    
    func TestJoinWithOmit(t *testing.T) {
    	user := *GetUser("joins_with_omit", Config{Pets: 2})
    	DB.Save(&user)
    
    	results := make([]*User, 0)
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Sun May 25 07:40:40 UTC 2025
    - 15K bytes
    - Viewed (0)
  7. tests/preload_test.go

    	var result struct {
    		Something string
    		User
    	}
    
    	DB.Model(User{}).Preload("Account", clause.Eq{Column: "number", Value: user.Account.Number}).Select(
    		"users.*, 'yo' as something").First(&result, "name = ?", user.Name)
    
    	CheckUser(t, user, result.User)
    }
    
    func TestNestedPreloadWithUnscoped(t *testing.T) {
    	user := *GetUser("nested_preload", Config{Pets: 1})
    	pet := user.Pets[0]
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Wed Jun 12 10:00:47 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  8. tests/generics_test.go

    		t.Errorf("found invalid user, got %v, expect %v", u, user)
    	}
    
    	if u, err := gorm.G[User](DB).Where("name = ?", user.Name).Take(ctx); err != nil {
    		t.Fatalf("failed to find user, got error: %v", err)
    	} else if u.Name != user.Name || u.ID != user.ID {
    		t.Errorf("found invalid user, got %v, expect %v", u, user)
    	}
    
    	if u, err := gorm.G[User](DB).Select("name").Where("name = ?", user.Name).First(ctx); err != nil {
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Sep 04 13:13:16 UTC 2025
    - 28K bytes
    - Viewed (0)
  9. tests/update_belongs_to_test.go

    	var user2 User
    	DB.Preload("Company").Preload("Manager").Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    
    	user.Company.Name += "new"
    	user.Manager.Name += "new"
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user3 User
    	DB.Preload("Company").Preload("Manager").Find(&user3, "id = ?", user.ID)
    	CheckUser(t, user2, user3)
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Jul 14 06:55:54 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  10. tests/create_test.go

    	user.CreatedAt = curTime
    	user.UpdatedAt = curTime
    	DB.Save(&user)
    
    	AssertEqual(t, user.CreatedAt, curTime)
    	AssertEqual(t, user.UpdatedAt, curTime)
    
    	var newUser User
    	DB.First(&newUser, user.ID)
    
    	AssertEqual(t, newUser.CreatedAt, curTime)
    	AssertEqual(t, newUser.UpdatedAt, curTime)
    }
    
    func TestCreateWithNowFuncOverride(t *testing.T) {
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Jul 21 09:55:20 UTC 2025
    - 26.8K bytes
    - Viewed (0)
Back to top