Example #1
0
File: db.py Project: chenhbzl/novel
 def insert_chapter (self, id, title, sort_num, book_id, volume_id):
     _sql = u"INSERT INTO tb_chapters(id, title, sort_num, book_id, volume_id, create_at) VALUES(%s, '%s', %s, %s, %s, %s)" % (int(id), title, int(sort_num), int(book_id), int(volume_id), unixtime())
     #print _sql
     return self.db.execute(_sql)
Example #2
0
File: db.py Project: chenhbzl/novel
 def insert_author (self, name):
     _sql = "INSERT INTO tb_author(name,create_at) VALUES('%s',%s)" % (name, unixtime())
     return self.db.execute(_sql)
Example #3
0
File: db.py Project: chenhbzl/novel
 def insert_volume (self, title, book_id):
     _sql = "INSERT INTO tb_volume(title,book_id,create_at) VALUES('%s',%s,%s)" % (title, book_id, unixtime())
     return self.db.execute(_sql)
Example #4
0
File: db.py Project: chenhbzl/novel
 def insert_book (self, id, name, description, author_id=0, category_id=0, is_finish=0, recommend_count=0):
     return self.db.execute(
         "INSERT INTO tb_book(id, name, description, author_id, category_id,is_finish,recommend_count,create_at) VALUES(%s,%s,%s,%s,%s,%s,%s,%s)", int(id), name, description, int(author_id), int(category_id), int(is_finish), int(recommend_count), unixtime()
     )