def _edit_tongji(self): # no need to set self.edited to True, because this doesn't need sync to douban try: url, datas = tongji.get_by_isbn(self.isbn) b = Book.get_by_isbn(self.isbn) b.set_tongji_info(url, datas) except Exception: # there may be errors, like this book 9787544717731, it also has e-version in TJ Lib.. pass
def post(self): isbn = self.request.get('isbn') if not isbn: return url, datas = tongji.get_by_isbn(isbn) b = Book.get_by_isbn(isbn) if b: b.set_tongji_info(url, datas) return
def post(self): isbn = self.request.get('isbn') if not isbn: return try: b = douban.get_book_by_isbn(isbn) except Exception: return if not b: return b_db = Book.get_by_isbn(isbn) if b_db: b_db.update_to(b) return