def get(self): StaticData.init(self) self.title = 'Edit Article' aid = self.get_argument('aid', default=None) if aid == None: article = Article('','',1,0) article.aid = None else: article = self.session.query(Article).filter(Article.aid == aid).first() categoryList = self.session.query(Category).all() self.render('admin_editpage.html', active2 = 'class="active"', article = article, categoryList = categoryList) self.session.close()
def get(self, uid): homeBase.init(self) aid = self.get_argument('aid',default=None) user = self.session.query(User).filter(User.uid == uid).first() self.title = 'Edit Article' typelist = self.session.query(Type).all() if aid == None: article = Article('','','','') article.aid = None else: article = self.session.query(Article).filter(Article.aid == aid).first() self.render('home_writepage.html', typelist = typelist, uid = uid, user = user, article = article) self.session.close()