def post(self): url = self.request.get('tb_link') listlink = nhaccuatui_new(url) ip = self.request.remote_addr try: log = Log() log.ip_address = ip log.put() for i in listlink: query = dbsongs().query(dbsongs.creator== i['creator'] , dbsongs.title == i['title'] ) if not query.get(): db = dbsongs() db.title = i['title'] db.creator=i['creator'] db.location =i['location'] db.lyric= i['lyric'] db.put() except: logging.error('There was an error retrieving posts from the datastore') pass self.response.out.write(json.dumps({"data":listlink}))
def post(self): url = self.request.get('tb_link') listlink = nhaccuatui_new(url) ip = self.request.remote_addr try: log = Log() log.ip_address = ip log.put() for i in listlink: query = dbsongs().query(dbsongs.creator == i['creator'], dbsongs.title == i['title']) if not query.get(): db = dbsongs() db.title = i['title'] db.creator = i['creator'] db.location = i['location'] db.lyric = i['lyric'] db.put() except: logging.error( 'There was an error retrieving posts from the datastore') pass self.response.out.write(json.dumps({"data": listlink}))
def post(self): query = dbsongs().all()