- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 17 for belongsTo (1.75 sec)
-
schema/relationship_test.go
"Country": { Name: "Country", Type: schema.BelongsTo, Schema: "Org", FieldSchema: "Country", References: []Reference{ {PrimaryKey: "ID", PrimarySchema: "Country", ForeignKey: "CountryID", ForeignSchema: "Org"}, }, }, }, }, "VisitingAddress": { Relations: map[string]Relation{ "Country": { Name: "Country", Type: schema.BelongsTo, Schema: "Org", FieldSchema: "Country",
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 15 03:20:20 GMT 2024 - 25.5K bytes - Viewed (0) -
schema/relationship.go
HasMany RelationshipType = "has_many" // HasManyRel has many relationship BelongsTo RelationshipType = "belongs_to" // BelongsToRel belongs to relationship Many2Many RelationshipType = "many_to_many" // Many2ManyRel many to many relationship has RelationshipType = "has" ) type Relationships struct { HasOne []*Relationship BelongsTo []*Relationship HasMany []*Relationship Many2Many []*Relationship
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 15 03:20:20 GMT 2024 - 22.4K bytes - Viewed (0) -
association.go
reflectValue := association.DB.Statement.ReflectValue rel := association.Relationship var oldBelongsToExpr clause.Expression // we have to record the old BelongsTo value if association.Unscope && rel.Type == schema.BelongsTo { var foreignFields []*schema.Field for _, ref := range rel.References { if !ref.OwnPrimaryKey { foreignFields = append(foreignFields, ref.ForeignKey) } }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu May 04 11:30:45 GMT 2023 - 21.2K bytes - Viewed (0) -
callbacks/associations.go
return func(db *gorm.DB) { if db.Error == nil && db.Statement.Schema != nil { selectColumns, restricted := db.Statement.SelectAndOmitColumns(create, !create) // Save Belongs To associations for _, rel := range db.Statement.Schema.Relationships.BelongsTo { if v, ok := selectColumns[rel.Name]; (ok && !v) || (!ok && restricted) { continue } setupReferences := func(obj reflect.Value, elem reflect.Value) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Apr 11 03:06:13 GMT 2023 - 14.3K bytes - Viewed (0) -
schema/schema_test.go
}, { Name: "Company", Type: schema.BelongsTo, Schema: "User", FieldSchema: "Company", References: []Reference{{"ID", "Company", "CompanyID", "User", "", false}}, }, { Name: "Manager", Type: schema.BelongsTo, Schema: "User", FieldSchema: "User", References: []Reference{{"ID", "User", "ManagerID", "User", "", false}}, }, {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:31:23 GMT 2023 - 12.9K bytes - Viewed (0) -
callbacks/update.go
db.Statement.ReflectValue = db.Statement.ReflectValue.Elem() } if dest, ok := db.Statement.Dest.(map[string]interface{}); ok { for _, rel := range db.Statement.Schema.Relationships.BelongsTo { if _, ok := dest[rel.Name]; ok { db.AddError(rel.Field.Set(db.Statement.Context, db.Statement.ReflectValue, dest[rel.Name])) } } } } } } // BeforeUpdate before update hooks
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 05:44:55 GMT 2024 - 9.4K bytes - Viewed (1) -
internal/disk/root_disk.go
// You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package disk import "runtime" // IsRootDisk returns if diskPath belongs to root-disk, i.e the disk mounted at "/" func IsRootDisk(diskPath string, rootDisk string) (bool, error) { if runtime.GOOS == "windows" { // On windows this function is not implemented. return false, nil }
Go - Registered: Sun Apr 28 19:28:10 GMT 2024 - Last Modified: Tue Jun 01 21:59:40 GMT 2021 - 1.1K bytes - Viewed (0) -
tests/update_belongs_to_test.go
. "gorm.io/gorm/utils/tests" ) func TestUpdateBelongsTo(t *testing.T) { user := *GetUser("update-belongs-to", Config{}) if err := DB.Create(&user).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } user.Company = Company{Name: "company-belongs-to-association"} user.Manager = &User{Name: "manager-belongs-to-association"} if err := DB.Save(&user).Error; err != nil {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jul 14 06:55:54 GMT 2022 - 1.6K bytes - Viewed (0) -
cmd/api-errors.go
Description: "Error parsing the Credential/X-Amz-Credential parameter; incorrect service. This endpoint belongs to \"s3\".", HTTPStatusCode: http.StatusBadRequest, }, ErrInvalidServiceSTS: { Code: "AuthorizationParametersError", Description: "Error parsing the Credential parameter; incorrect service. This endpoint belongs to \"sts\".", HTTPStatusCode: http.StatusBadRequest, }, ErrInvalidRequestVersion: {
Go - Registered: Sun Apr 28 19:28:10 GMT 2024 - Last Modified: Mon Apr 22 17:49:30 GMT 2024 - 90.6K bytes - Viewed (6) -
internal/etag/etag.go
// such an ETag (with a nonce value containing a '-') // as non-encrypted. return len(e) >= 32 // We consider all ETags longer than 32 bytes as encrypted } // IsMultipart reports whether the ETag belongs to an // object that has been uploaded using the S3 multipart // API. // An S3 multipart ETag has a -<part-number> suffix. func (e ETag) IsMultipart() bool {
Go - Registered: Sun Apr 28 19:28:10 GMT 2024 - Last Modified: Sun Mar 10 21:09:36 GMT 2024 - 13.3K bytes - Viewed (0)