make validation less verbose (#23)
This commit is contained in:
parent
fded3c23d0
commit
d51ed8defd
9 changed files with 22 additions and 22 deletions
|
|
@ -5,7 +5,7 @@ import "sort"
|
|||
// List represents a list of tasks
|
||||
type List struct {
|
||||
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"list"`
|
||||
Title string `xorm:"varchar(250)" json:"title" valid:"required,runelength(5|250)"`
|
||||
Title string `xorm:"varchar(250)" json:"title" valid:"required,runelength(3|250)"`
|
||||
Description string `xorm:"varchar(1000)" json:"description" valid:"runelength(0|1000)"`
|
||||
OwnerID int64 `xorm:"int(11) INDEX" json:"-"`
|
||||
NamespaceID int64 `xorm:"int(11) INDEX" json:"-" param:"namespace"`
|
||||
|
|
@ -13,8 +13,8 @@ type List struct {
|
|||
Owner User `xorm:"-" json:"owner"`
|
||||
Tasks []*ListTask `xorm:"-" json:"tasks"`
|
||||
|
||||
Created int64 `xorm:"created" json:"created" valid:"range(0|0)"`
|
||||
Updated int64 `xorm:"updated" json:"updated" valid:"range(0|0)"`
|
||||
Created int64 `xorm:"created" json:"created"`
|
||||
Updated int64 `xorm:"updated" json:"updated"`
|
||||
|
||||
CRUDable `xorm:"-" json:"-"`
|
||||
Rights `xorm:"-" json:"-"`
|
||||
|
|
|
|||
Reference in a new issue