Esempio n. 1
0
 def getjson(self):
     request = self.request
     myModelProvider = MyModelProvider(request.db_session)
     id = request.matchdict['id']
     json = myModelProvider.getById(id)
     print json
     return {}
Esempio n. 2
0
    def home(self):
        request = self.request
        myModelProvider = MyModelProvider(request.db_session)
        modelLists = myModelProvider.getList()
        # lists = [{'id':'1','value':'{"abc"="123"}'},{'id':'2','value':'{"xyz"="456"}'}]
        lists=[]
        for model in modelLists:
            list={}
            list['id'] = model.id
            list['value'] = model.value
            lists.append(list)

        return dict(title='Json Service', lists=lists)