Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { Id int `orm:"pk;auto"` ArtiName string `orm:"size(32);default(一篇好文章)"` Atime time.Time `orm:"auto_now;type(datetime)"` Acount int `orm:"default(0);null"` Acontent string `orm:"null"` //默认不能为NULL, 这样设置之后可以为NULL Aimg string User []*User `orm:"reverse(many)"` //多对多 ArticleType *ArticleType `orm:"rel(fk)"` //一对多 BeginTime time.Time `orm:"auto_now_add;type(datetime)"` //第一次保存时才设置时间 UpdateTime time.Time `orm:"auto_now;type(date)"` //保存时都会对时间自动更新 }
----------------------一对多begin--------
type ArticleType ¶
Click to show internal directories.
Click to hide internal directories.