hai, i don't know how to retrive data from database
this is my python file
@http.route('/sample/demo', auth='public',website=True)
def click(self, **post):
print "post data===================>",post
cr = request.cr
pool = request.registry
table_name=post.get('t_name',False)
user_id = post.get('user_id',False)
response_dict = {}
jd=[]
if user_id and table_name:
print"Enterloginpage======================="
return http.request.render('json.arun1')
else:
print "Invalid user_id"
return http.request.render('json.arunkumar')
--------------------------------------------------------------------------------
@http.route('/course/datas', auth='public',website=True)
def index12(self, **post):
print "post data===================>",post
cr = request.cr
print"==============================>"
# cr.execute("select coursename,coursefee from course_datas")
cr.execute("select * from table_name")
res=cr.dictfetchall()
print "****************",res;
rect=[]
if res:
jd = json.dumps(res)
print "Datas Json",jd
return jd