Make validation less verbose (#24)
This commit is contained in:
parent
e5c1588576
commit
b73786f7fe
5 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ type List struct {
|
||||||
OwnerID int64 `xorm:"int(11) INDEX" json:"-"`
|
OwnerID int64 `xorm:"int(11) INDEX" json:"-"`
|
||||||
NamespaceID int64 `xorm:"int(11) INDEX" json:"-" param:"namespace"`
|
NamespaceID int64 `xorm:"int(11) INDEX" json:"-" param:"namespace"`
|
||||||
|
|
||||||
Owner User `xorm:"-" json:"owner"`
|
Owner User `xorm:"-" json:"owner" valid:"-"`
|
||||||
Tasks []*ListTask `xorm:"-" json:"tasks"`
|
Tasks []*ListTask `xorm:"-" json:"tasks"`
|
||||||
|
|
||||||
Created int64 `xorm:"created" json:"created"`
|
Created int64 `xorm:"created" json:"created"`
|
||||||
|
|
|
@ -14,7 +14,7 @@ type ListTask struct {
|
||||||
Created int64 `xorm:"created" json:"created"`
|
Created int64 `xorm:"created" json:"created"`
|
||||||
Updated int64 `xorm:"updated" json:"updated"`
|
Updated int64 `xorm:"updated" json:"updated"`
|
||||||
|
|
||||||
CreatedBy User `xorm:"-" json:"createdBy"`
|
CreatedBy User `xorm:"-" json:"createdBy" valid:"-"`
|
||||||
|
|
||||||
CRUDable `xorm:"-" json:"-"`
|
CRUDable `xorm:"-" json:"-"`
|
||||||
Rights `xorm:"-" json:"-"`
|
Rights `xorm:"-" json:"-"`
|
||||||
|
|
|
@ -76,7 +76,7 @@ func (i *ListTask) Update() (err error) {
|
||||||
ot.Done = false
|
ot.Done = false
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = x.ID(i.ID).Cols("text", "description", "done", "due_date_unix", "reminder_unix").Update(ot)
|
_, err = x.ID(i.ID).Cols("text", "description", "done", "due_date_unix", "reminders_unix").Update(ot)
|
||||||
*i = ot
|
*i = ot
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ type Namespace struct {
|
||||||
Description string `xorm:"varchar(1000)" json:"description" valid:"runelength(0|250)"`
|
Description string `xorm:"varchar(1000)" json:"description" valid:"runelength(0|250)"`
|
||||||
OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"`
|
OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"`
|
||||||
|
|
||||||
Owner User `xorm:"-" json:"owner"`
|
Owner User `xorm:"-" json:"owner" valid:"-"`
|
||||||
|
|
||||||
Created int64 `xorm:"created" json:"created"`
|
Created int64 `xorm:"created" json:"created"`
|
||||||
Updated int64 `xorm:"updated" json:"updated"`
|
Updated int64 `xorm:"updated" json:"updated"`
|
||||||
|
|
|
@ -15,7 +15,7 @@ type UserLogin struct {
|
||||||
// User holds information about an user
|
// User holds information about an user
|
||||||
type User struct {
|
type User struct {
|
||||||
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"`
|
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"`
|
||||||
Username string `xorm:"varchar(250) not null unique" json:"username" valid:"length(5|250)"`
|
Username string `xorm:"varchar(250) not null unique" json:"username" valid:"length(3|250)"`
|
||||||
Password string `xorm:"varchar(250) not null" json:"-"`
|
Password string `xorm:"varchar(250) not null" json:"-"`
|
||||||
Email string `xorm:"varchar(250)" json:"email" valid:"email,length(0|250)"`
|
Email string `xorm:"varchar(250)" json:"email" valid:"email,length(0|250)"`
|
||||||
IsActive bool `json:"-"`
|
IsActive bool `json:"-"`
|
||||||
|
|
Loading…
Reference in a new issue