Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
 def post(self):
     form = forms.HelloForm(self)
     if form.validate():
         self.write('Hello %s' % form.planet.data)
     else:
         self.render('index.html', form=form)
Beispiel #4
0
 def get(self):
     form = forms.HelloForm()
     self.render('blog.html', form=form)
Beispiel #5
0
 def get(self):
     form = forms.HelloForm()
     self.render('about.html', form=form)
Beispiel #6
0
 def get(self):
     form = forms.HelloForm()
     self.render('resume.html', form=form)