// view for list model data func (this *PageAdminRouter) List() { var pages []models.Page qs := models.Pages().RelatedSel() if err := this.SetObjects(qs, &pages); err != nil { this.Data["Error"] = err beego.Error(err) } }
func (this *PageRouter) loadPage(page *models.Page) bool { uri := this.Ctx.Request.RequestURI err := models.Pages().RelatedSel("User").Filter("IsPublish", true).Filter("Uri", uri).One(page) if err == nil { this.Data["Page"] = page } else { this.Abort("404") } return err != nil }
func (this *PageAdminRouter) ObjectQs() orm.QuerySeter { return models.Pages().RelatedSel() }