示例#1
0
func (this *CategoryController) Store() {
	pid, _ := strconv.Atoi(this.GetString("Pid"))
	name := this.GetString("Name")
	o := orm.NewOrm()
	category := new(models.Category)
	category.Pid = int64(pid)
	category.Name = name
	//category := &models.Category{Pid:int64(pid),Name:name}
	o.Insert(category)
	this.Redirect(beego.UrlFor("CategoryController.Index"), 302)

}