예제 #1
0
//Save saves a TimeConfig to Datastore.
//If its Key field is set, it will replace an existing record
//that has that key. If not, it will use datastore.NewIncompleteKey()
//to create a new key and set the field.
func (tc *TimeConfig) Save(c appengine.Context) (err error) {
	tc.Date = util.NormalizeDate(tc.Date)
	tc.Off = util.NormalizeTime(tc.Off)
	tc.On = util.NormalizeTime(tc.On)
	err = gaemodel.Save(c, tc)
	if err != nil {
		return
	}

	err = config.UpdateTimestamp(c)
	return
}
예제 #2
0
//Save saves presentation to Datastore.
func (p *Presentation) Save(c appengine.Context) (err error) {
	return gaemodel.Save(c, p)
}
예제 #3
0
func (a *Activation) Save(c appengine.Context) error {
	return gaemodel.Save(c, a)
}