Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 3,258 for Save (0.48 sec)

  1. tests/non_std_test.go

    	if err := DB.AutoMigrate(&Animal{}); err != nil {
    		t.Fatalf("no error should happen when migrate but got %v", err)
    	}
    
    	animal := Animal{Name: "Ferdinand"}
    	DB.Save(&animal)
    	updatedAt1 := animal.UpdatedAt
    
    	DB.Save(&animal).Update("name", "Francis")
    	if updatedAt1.Format(time.RFC3339Nano) == animal.UpdatedAt.Format(time.RFC3339Nano) {
    		t.Errorf("UpdatedAt should be updated")
    	}
    
    	var animals []Animal
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  2. tests/embedded_struct_test.go

    	} else if len(stmt.Schema.PrimaryFields) != 1 {
    		t.Errorf("should have only one primary field with embedded struct, but got %v", len(stmt.Schema.PrimaryFields))
    	}
    
    	for _, name := range []string{"user_id", "user_name", "user_email"} {
    		if !DB.Migrator().HasColumn(&HNPost{}, name) {
    			t.Errorf("should has prefixed column %v", name)
    		}
    	}
    
    	// save embedded struct
    	DB.Save(&HNPost{BasePost: BasePost{Title: "news"}})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  3. tests/preload_suits_test.go

    		t.Error(err)
    	}
    
    	lvl := &Level3{}
    	if err := DB.Save(lvl).Error; err != nil {
    		t.Error(err)
    	}
    
    	sublvl1 := &Level4{Level3ID: lvl.ID}
    	if err := DB.Save(sublvl1).Error; err != nil {
    		t.Error(err)
    	}
    	sublvl2 := &Level4{Level3ID: lvl.ID}
    	if err := DB.Save(sublvl2).Error; err != nil {
    		t.Error(err)
    	}
    
    	lvl.Level4s = []*Level4{sublvl1, sublvl2}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Mar 18 05:38:46 GMT 2022
    - 30.3K bytes
    - Viewed (0)
  4. docs/debugging/pprofgoparser/main.go

    			if searchRE == nil || searchRE.MatchString(stackTrace) {
    				ret[t] = append(ret[t], stackTrace)
    			}
    		case record:
    			save(line)
    		default:
    			z := goroutinesRE.FindStringSubmatch(line)
    			if len(z) == 3 {
    				if z[2] != "" {
    					a, _ := strconv.Atoi(z[2])
    					t = time.Duration(a) * time.Minute
    					save(line)
    					record = true
    				} else {
    					skip = true
    				}
    			}
    		}
    	}
    
    	return ret, nil
    }
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Mar 06 11:43:16 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  5. docs_src/extra_models/tutorial001.py

        return "supersecret" + raw_password
    
    
    def fake_save_user(user_in: UserIn):
        hashed_password = fake_password_hasher(user_in.password)
        user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
        print("User saved! ..not really")
        return user_in_db
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user_in: UserIn):
        user_saved = fake_save_user(user_in)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 943 bytes
    - Viewed (0)
  6. docs_src/extra_models/tutorial001_py310.py

        return "supersecret" + raw_password
    
    
    def fake_save_user(user_in: UserIn):
        hashed_password = fake_password_hasher(user_in.password)
        user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
        print("User saved! ..not really")
        return user_in_db
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user_in: UserIn):
        user_saved = fake_save_user(user_in)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 899 bytes
    - Viewed (0)
  7. callbacks/callbacks.go

    	createCallback.Register("gorm:before_create", BeforeCreate)
    	createCallback.Register("gorm:save_before_associations", SaveBeforeAssociations(true))
    	createCallback.Register("gorm:create", Create(config))
    	createCallback.Register("gorm:save_after_associations", SaveAfterAssociations(true))
    	createCallback.Register("gorm:after_create", AfterCreate)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  8. docs_src/sql_databases_peewee/sql_app/crud.py

        db_user.save()
        return db_user
    
    
    def get_items(skip: int = 0, limit: int = 100):
        return list(models.Item.select().offset(skip).limit(limit))
    
    
    def create_user_item(item: schemas.ItemCreate, user_id: int):
        db_item = models.Item(**item.dict(), owner_id=user_id)
        db_item.save()
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 843 bytes
    - Viewed (0)
  9. tests/test_put_no_body.py

                                        }
                                    }
                                },
                            },
                        },
                        "summary": "Save Item No Body",
                        "operationId": "save_item_no_body_items__item_id__put",
                        "parameters": [
                            {
                                "required": True,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  10. docs_src/extra_models/tutorial002_py310.py

        return "supersecret" + raw_password
    
    
    def fake_save_user(user_in: UserIn):
        hashed_password = fake_password_hasher(user_in.password)
        user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
        print("User saved! ..not really")
        return user_in_db
    
    
    @app.post("/user/", response_model=UserOut)
    async def create_user(user_in: UserIn):
        user_saved = fake_save_user(user_in)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 792 bytes
    - Viewed (0)
Back to top