All pastes #767607 Raw Edit

IndiCoyote

public python v1 · immutable
·published 2007-11-09 22:09 UTC
rendered paste body
    @check_perm('administrate')    def edit(self):        news_q = model.Session.query(model.News)        c.item = news_q.filter_by(id = c.id).one()        c.form_defaults = c.item # <- Doesn't work right, what does?        return render('news/edit.mako')# Result:# >>  context.write(unicode(h.text_field('title', value=c.form_defaults['title'] or '')))# <type 'exceptions.TypeError'>: 'News' object is unsubscriptable