Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database relations #33

Open
NarHakobyan opened this issue Feb 27, 2018 · 1 comment
Open

Database relations #33

NarHakobyan opened this issue Feb 27, 2018 · 1 comment

Comments

@NarHakobyan
Copy link

NarHakobyan commented Feb 27, 2018

Is it supports database relations? For example code below.

type User struct {
	Model
	Name     string         `form:"name" json:"name" valid:"required~Name is required"`
	Email    string         `form:"email" gorm:"unique_index" json:"email" valid:"email~Email isn't valid"`
   --->Stores   []Store        `form:"stores" json:"stores" valid:"email~Stores isn't valid"`
	Password string         `form:"password" json:"-" valid:"required~Password is required"`
	BirthDay time.Time      `form:"birthday" json:"birthday" valid:"required~Birth day is required" time_format:"02-01-2006"`
	Role     roles.RoleType `gorm:"default:0" json:"role"`
}
@jirfag
Copy link
Owner

jirfag commented Jun 2, 2018

Hello!
Sorry for the late response, yes, it has limited support. Look at PreloadXXX method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants