Exemplo n.º 1
0
 def get(self, *args, **kwargs):
     #去数据库中提取数据
     # stu = Students("fghjkiuhbn",567)
     # stu.save()
     # self.write("ok")
     stus = Students.all()
     self.render('students.html', stus=stus)
Exemplo n.º 2
0
 def get(self, *args, **kwargs):
     # 查找数据库提取数据
     # sql = 'select name, age from students;'
     # sql = 'insert into students (name, age) values ("tom", 30);'
     # stus = self.application.db.get_all_obj(sql, 'students', 'name', 'age')
     # print(stus, '---------')
     # self.application.ORM.insert(sql)
     # s = Students('LAJOS', 20)
     # s.save()
     stus = Students.all()
     print(stus, '+++++++++++++=')
     self.write('lajos is a handsome man!')