Search Options

Results per page
Sort
Preferred Languages
Advance

Results 131 - 140 of 1,487 for uber (0.03 sec)

  1. schema/relationship_test.go

    	type User struct {
    		ID        int32 `gorm:"primaryKey"`
    		Name      string
    		CreatorID *int32
    		Creator   *User
    	}
    
    	checkStructRelation(t, &User{}, Relation{
    		Name: "Creator", Type: schema.BelongsTo, Schema: "User", FieldSchema: "User",
    		References: []Reference{{"ID", "User", "CreatorID", "User", "", false}},
    	})
    }
    
    func TestSelfReferentialBelongsToOverrideReferences(t *testing.T) {
    	type User struct {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  2. tests/update_test.go

    	} else {
    		CheckUser(t, result2, *user)
    	}
    
    	if err := DB.Model(user).Updates(User{Age: 2}).Error; err != nil {
    		t.Errorf("errors happened when update: %v", err)
    	} else if user.Age != 2 {
    		t.Errorf("Age should equals to 2, but got %v", user.Age)
    	}
    	checkUpdatedAtChanged("Updates with struct", user.UpdatedAt)
    	checkOtherData("Updates with struct")
    
    	var result3 User
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Dec 04 03:50:58 UTC 2023
    - 30.3K bytes
    - Viewed (0)
  3. tests/associations_many2many_test.go

    		languages = append(languages, language)
    	}
    
    	user := User{}
    	db.Create(&user)
    	db.Preload("Languages").FirstOrCreate(&user)
    
    	var wg sync.WaitGroup
    	for i := 0; i < count; i++ {
    		wg.Add(1)
    		go func(user User, language Language) {
    			err := db.Model(&user).Association("Languages").Append(&language)
    			AssertEqual(t, err, nil)
    
    			wg.Done()
    		}(user, languages[i])
    	}
    	wg.Wait()
    
    	var find User
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Jun 10 13:05:19 UTC 2023
    - 13.2K bytes
    - Viewed (0)
  4. tests/transaction_test.go

    			if err := tx.First(&User{}, "name = ?", user.Name).Error; err != nil {
    				t.Fatalf("Should find saved record")
    			}
    
    			panic("force panic")
    		})
    	})
    
    	if err := DB.First(&User{}, "name = ?", "transaction-block-3").Error; err == nil {
    		t.Fatalf("Should not find record after panic rollback")
    	}
    }
    
    func TestTransactionRaiseErrorOnRollbackAfterCommit(t *testing.T) {
    	tx := DB.Begin()
    	user := User{Name: "transaction"}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Sep 14 12:58:29 UTC 2024
    - 12.9K bytes
    - Viewed (0)
  5. tests/delete_test.go

    		}
    	}
    
    	for _, user := range []User{users[0], users[2]} {
    		result = User{}
    		if err := DB.Where("id = ?", user.ID).First(&result).Error; err != nil {
    			t.Errorf("no error should returns when query %v, but got %v", user.ID, err)
    		}
    	}
    
    	if err := DB.Delete(&users[0]).Error; err != nil {
    		t.Errorf("errors happened when delete: %v", err)
    	}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Oct 10 07:03:34 UTC 2023
    - 9.4K bytes
    - Viewed (0)
  6. src/main/java/org/codelibs/fess/ldap/LdapManager.java

                            });
                            user.setGroups(groupList.toArray(new String[groupList.size()]));
                            user.setRoles(roleList.toArray(new String[roleList.size()]));
                        }
                    });
    
        }
    
        public void insert(final User user) {
            if (!fessConfig.isLdapAdminEnabled(user.getName())) {
                return;
            }
    
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Thu Feb 22 01:53:18 UTC 2024
    - 65.9K bytes
    - Viewed (0)
  7. clause/joins_test.go

    				},
    			},
    			sql: "INNER JOIN `user` USING (`id`)",
    		},
    	}
    	for _, result := range results {
    		t.Run(result.name, func(t *testing.T) {
    			user, _ := schema.Parse(&tests.User{}, &sync.Map{}, db.NamingStrategy)
    			stmt := &gorm.Statement{DB: db, Table: user.Table, Schema: user, Clauses: map[string]clause.Clause{}}
    			result.join.Build(stmt)
    			if result.sql != stmt.SQL.String() {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Nov 03 13:03:13 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  8. tests/test_response_model_as_return_annotation.py

    class BaseUser(BaseModel):
        name: str
    
    
    class User(BaseUser):
        surname: str
    
    
    class DBUser(User):
        password_hash: str
    
    
    class Item(BaseModel):
        name: str
        price: float
    
    
    app = FastAPI()
    
    
    @app.get("/no_response_model-no_annotation-return_model")
    def no_response_model_no_annotation_return_model():
        return User(name="John", surname="Doe")
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Aug 14 09:49:57 UTC 2023
    - 47.7K bytes
    - Viewed (0)
  9. docs_src/security/tutorial004_an.py

            raise credentials_exception
        user = get_user(fake_users_db, username=token_data.username)
        if user is None:
            raise credentials_exception
        return user
    
    
    async def get_current_active_user(
        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  10. docs_src/security/tutorial005.py

    
    def authenticate_user(fake_db, username: str, password: str):
        user = get_user(fake_db, username)
        if not user:
            return False
        if not verify_password(password, user.hashed_password):
            return False
        return user
    
    
    def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
        to_encode = data.copy()
        if expires_delta:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 5.2K bytes
    - Viewed (0)
Back to top