示例#1
0
// get function
func (self *ManageArticleWaitress) Get(w http.ResponseWriter, r *http.Request, c appengine.Context) {
	// get all articles
	articles, err := ds.GetAllArticles(c)
	oops(err, w)
	// setup build cube
	buildCube := core.GetBuildCube(self.GetApp(), r)
	buildCube["PageCube"]["Articles"] = articles

	sharedTempler.BuildPage(c, w, buildCube, "baseTpl", "manageArtTpl")
	return
}
示例#2
0
// over write "Get" method
func (self *HomeWaitress) Get(w http.ResponseWriter, r *http.Request, c appengine.Context) {
	// get all articles
	articles, err := ds.GetAllArticles(c)
	oops(err, w)
	aFloats, err := ds.GetAllAFloat(c)
	oops(err, w)
	// setup
	buildCube := core.GetBuildCube(self.GetApp(), r)
	buildCube["PageCube"]["Articles"] = articles
	buildCube["PageCube"]["AFloats"] = aFloats
	// build page
	err = sharedTempler.BuildPage(c, w, buildCube, "baseTpl", "homeTpl")
	oops(err, w)
}