1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 16:50:19 +00:00

orm support complete m2m operation api / auto load related api

This commit is contained in:
slene
2013-10-14 22:31:35 +08:00
parent e11c40eee4
commit d043ebcdd3
11 changed files with 850 additions and 234 deletions

View File

@ -99,10 +99,11 @@ func NewUser() *User {
}
type Profile struct {
Id int
Age int16
Money float64
User *User `orm:"reverse(one)" json:"-"`
Id int
Age int16
Money float64
User *User `orm:"reverse(one)" json:"-"`
BestPost *Post `orm:"rel(one);null"`
}
func (u *Profile) TableName() string {
@ -136,9 +137,10 @@ func NewPost() *Post {
}
type Tag struct {
Id int
Name string `orm:"size(30)"`
Posts []*Post `orm:"reverse(many)" json:"-"`
Id int
Name string `orm:"size(30)"`
BestPost *Post `orm:"rel(one);null"`
Posts []*Post `orm:"reverse(many)" json:"-"`
}
func NewTag() *Tag {