func updateAttributes(p *plan.Plan, r *http.Request) { // TODO this needs to be changed. Not a good place to put this. if name := r.PostForm.Get("plan[name]"); name != "" { p.Name = name } if num := getFormInt("plan[num]", r); num > 0 { p.Num = num } if jobId := getFormInt("plan[job_id]", r); jobId > 0 { p.JobId = jobId } }