def get(self, aid=None): if aid is None: aid = self.aid form = forms.HelloForm() a = A.select().where(A.id == aid).get() blist = [(b, C.select().where(C.parent == b)) for b in B.select().where(B.parent == a)] context = {'a': a, 'blist': blist, 'form': form} self.render('index.html', **context)
def get(self): form = forms.HelloForm() a = A.select().where(A.id == 1).get() blist = [(b, C.select().where(C.parent == b)) for b in B.select().where(B.parent == a)] context = {'a': a, 'blist': blist, 'form': form} alist = A.select().order_by(A.id) context.update(alist=alist) self.render('index.html', **context)
def post(self): form = forms.HelloForm(self) if form.validate(): self.write('Hello %s' % form.planet.data) else: self.render('index.html', form=form)
def get(self): form = forms.HelloForm() self.render('blog.html', form=form)
def get(self): form = forms.HelloForm() self.render('about.html', form=form)
def get(self): form = forms.HelloForm() self.render('resume.html', form=form)