func getTemplate(ctx dingo.Context, key string) (t *template.Template, b []byte, err error) { c := appengine.NewContext(ctx.Request) if b, err = getTemplateBytes(c, key); err == nil { t = views.NewTmpl(key) t, err = t.Parse(string(b)) } return }
func (g *gae) Save(ctx dingo.Context, data []byte) error { t := views.NewTmpl("") if _, err := t.Parse(string(data)); err != nil { return err } b := &TemplateBytes{data} c := appengine.NewContext(ctx.Request) k := datastore.NewKey(c, "Template", g.ViewName, 0, nil) if _, err := datastore.Put(c, k, b); err != nil { fmt.Printf("dingo [TEMPLATE_BIGTABLE_SAVE_ERR] / {%v} - %v\n", g.ViewName, err) } g.Reload(ctx) return nil }