admin page updates
This commit is contained in:
@@ -2,6 +2,7 @@ package validation
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.haelnorr.com/h/golib/hws"
|
||||
"git.haelnorr.com/h/timefmt"
|
||||
@@ -21,6 +22,10 @@ func (q *QueryGetter) Get(key string) string {
|
||||
return q.r.URL.Query().Get(key)
|
||||
}
|
||||
|
||||
func (q *QueryGetter) GetList(key string) []string {
|
||||
return strings.Split(q.Get(key), ",")
|
||||
}
|
||||
|
||||
func (q *QueryGetter) getChecks() []*ValidationRule {
|
||||
return q.checks
|
||||
}
|
||||
@@ -45,6 +50,14 @@ func (q *QueryGetter) Time(key string, format *timefmt.Format) *TimeField {
|
||||
return newTimeField(key, format, q)
|
||||
}
|
||||
|
||||
func (q *QueryGetter) StringList(key string) *StringList {
|
||||
return newStringList(key, q)
|
||||
}
|
||||
|
||||
func (q *QueryGetter) IntList(key string) *IntList {
|
||||
return newIntList(key, q)
|
||||
}
|
||||
|
||||
func (q *QueryGetter) Validate() bool {
|
||||
return len(validate(q)) == 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user