Example #1
0
 def get(self, page=1):
     max_page = Staff.max_staff_page_all()
     staffs = Staff.select().paginate(page, 10)
     return render_template('staffs/list.html',
                            staffs=staffs,
                            max_page=max_page,
                            page=page,
                            title='Staff List')
Example #2
0
 def get(self, page=1):
     max_page = Staff.max_staff_page_all()
     if Staff.select().count() != 0:
         staffs = Staff.select().paginate(page, 10)
         return render_template('staffs/simlist.html',
                                staffs=staffs,
                                max_page=max_page,
                                page=page)
     else:
         content = 'No staffs hav been added yet'
         return render_template('info.html', content=content, title='staff')