Ejemplo n.º 1
0
func (i *Item) Validate(v *revel.Validation) {
	v.Check(i.Name,
		revel.ValidRequired(),
		revel.ValidMaxSize(25))
	v.Check(i.Stock,
		revel.ValidRequired())
	v.Check(i.Cost,
		revel.ValidRequired())
}
Ejemplo n.º 2
0
func (b *BidItem) Validate(v *revel.Validation) {

	v.Check(b.Name,
		revel.ValidRequired(),
		revel.ValidMaxSize(25))

	v.Check(b.Category,
		revel.ValidRequired(),
		revel.ValidMatch(
			regexp.MustCompile(
				"^(travel|leasure|sports|entertainment)$")))

	v.Check(b.EstimatedValue,
		revel.ValidRequired())

	v.Check(b.StartBid,
		revel.ValidRequired())

	v.Check(b.BidIncrement,
		revel.ValidRequired())
}
Ejemplo n.º 3
0
func (m *Label) Validate(v *revel.Validation) {
	v.Check(m.Name, revel.ValidRequired())
}
Ejemplo n.º 4
0
func (m *Subscribe) Validate(v *revel.Validation) {
	v.Check(m.UserId, revel.ValidRequired())
	v.Check(m.Type, revel.ValidRequired())
	v.Check(m.TypeId, revel.ValidRequired())
	v.Check(m.Created, revel.ValidRequired())
}
Ejemplo n.º 5
0
func (m *Keyword) Validate(v *revel.Validation) {
	v.Check(m.Keyword, revel.ValidRequired())
}
Ejemplo n.º 6
0
func (m *Notification) Validate(v *revel.Validation) {
	v.Check(m.NoticeTo, revel.ValidRequired())
	v.Check(m.Message, revel.ValidRequired())
}
Ejemplo n.º 7
0
func (m *Profile) Validate(v *revel.Validation) {
	v.Check(m.Id, revel.ValidRequired())
	v.Check(m.Gender, revel.ValidRequired())
	v.Check(m.Age, revel.ValidRequired())
	v.Check(m.Lllness, revel.ValidRequired())
}
Ejemplo n.º 8
0
func (m *UserLoadedMaxTopic) Validate(v *revel.Validation) {
	v.Check(m.UserId, revel.ValidRequired())
	v.Check(m.MaxTopicId, revel.ValidRequired())
}
Ejemplo n.º 9
0
func (m *Session) Validate(v *revel.Validation) {
	v.Check(m.Session, revel.ValidRequired())
}
Ejemplo n.º 10
0
func (m *Like) Validate(v *revel.Validation) {
	v.Check(m.UserId, revel.ValidRequired())
	v.Check(m.Type, revel.ValidRequired())
	v.Check(m.TypeId, revel.ValidRequired())
}
Ejemplo n.º 11
0
func (m *UserLikeKeywordRate) Validate(v *revel.Validation) {
	v.Check(m.UserId, revel.ValidRequired())
	v.Check(m.KeywordId, revel.ValidRequired())
	v.Check(m.Rate, revel.ValidRequired())
}
Ejemplo n.º 12
0
func (m *LabelHasKeyword) Validate(v *revel.Validation) {
	v.Check(m.LabelId, revel.ValidRequired())
	v.Check(m.KeywordId, revel.ValidRequired())
}
Ejemplo n.º 13
0
func (m *UserBlocked) Validate(v *revel.Validation) {
	v.Check(m.UserId, revel.ValidRequired())
	v.Check(m.Blocked, revel.ValidRequired())
	v.Check(m.Created, revel.ValidRequired())
}
Ejemplo n.º 14
0
func (m *Topic) Validate(v *revel.Validation) {
	v.Check(m.UserId, revel.ValidRequired())
	v.Check(m.Content, revel.ValidRequired())
}
Ejemplo n.º 15
0
func (m *User) Validate(v *revel.Validation) {
	v.Check(m.Username, revel.ValidRequired(), revel.ValidMaxSize(25))
	v.Check(m.Password, revel.ValidRequired(), revel.ValidMinSize(6))
}
Ejemplo n.º 16
0
func (o *Object) Validate(v *revel.Validation) {
	// all OIDs are 65 characters long
	v.Check(o.Oid,
		revel.ValidRequired(),
		revel.ValidMaxSize(65))
}
Ejemplo n.º 17
0
func (m *Comment) Validate(v *revel.Validation) {
	v.Check(m.TopicId, revel.ValidRequired())
	v.Check(m.Creator, revel.ValidRequired())
	v.Check(m.Content, revel.ValidRequired())
}