Пример #1
0
func putClass(c appengine.Context, cls *classes.Class) {
	key := classes.NewClassKey(c, cls.ID)
	if _, err := datastore.Put(c, key, cls); err != nil {
		panic(err)
	}
}
Пример #2
0
func (s *Student) key(c appengine.Context) *datastore.Key {
	return datastore.NewKey(c, "Student", s.ID, 0, classes.NewClassKey(c, s.ClassID))
}