Esempio n. 1
0
 def isBlogExistByTitle(self, title):
     dao = DaoBaseService()
     obj = dao.query(SqlConstants.IS_BLOG_EXIST_BY_TITLE % title)
     num = obj[0][0]
     if num == 0:
         return False
     else:
         return True
Esempio n. 2
0
 def query_categories(self):
     dao = DaoBaseService()
     obj = dao.query(SqlConstants.QUERY_CATEGORIES_BY_ID % 2)
     return CommonUtils.query_result_to_categories(obj)
Esempio n. 3
0
 def delete_blog(self, blog_id):
     dao = DaoBaseService()
     dao.delete(SqlConstants.DELETE_BLOG % blog_id)
Esempio n. 4
0
 def update_portal_show(self, blog_id):
     dao = DaoBaseService()
     dao.update(SqlConstants.UPDATE_PORTAL_SHOW % blog_id)
Esempio n. 5
0
 def update_time_category(self, category_id, next_run_time):
     dao = DaoBaseService()
     dao.update(SqlConstants.UPDATE_TIME_CATEGORY %
                (next_run_time, category_id))
Esempio n. 6
0
 def insert_html_tags(self, parms):
     dao = DaoBaseService()
     dao.insert(SqlConstants.INSERT_HTML_TAGS, parms)
Esempio n. 7
0
 def update_time_t_crawler(self, crawler_id, next_run_time):
     dao = DaoBaseService()
     dao.update(SqlConstants.UPDATE_TIME_T_CRAWLER %
                (next_run_time, crawler_id))
Esempio n. 8
0
 def query_tcrawler_by_id(self, id):
     dao = DaoBaseService()
     obj = dao.query(SqlConstants.QUERY_TCRAWLER_BY_ID % (id))
     return CommonUtils.query_result_to_t_crawler(obj[0])
Esempio n. 9
0
 def query_all_tcrawlers_category(self, id):
     dao = DaoBaseService()
     obj = dao.query(SqlConstants.QUERY_ALL_TCRAWLERS_CATEGORY % (id))
     return CommonUtils.query_result_to_t_crawlers(obj)
Esempio n. 10
0
 def insert_blog(self, blog):
     dao = DaoBaseService()
     parm = (blog._Blog__title, blog._Blog__author, blog._Blog__content,
             blog._Blog__weight, blog._Blog__url, blog._Blog__category_id)
     return dao.insert_id(SqlConstants.INSERT_BLOG, parm)
Esempio n. 11
0
 def query_tag_by_id(self, id):
     dao = DaoBaseService()
     obj = dao.query(SqlConstants.QUERY_HTML_TAG_BY_ID % id)
     return CommonUtils.query_result_to_tag(obj[0])
Esempio n. 12
0
 def query_tags_by_crawler_id(self, id):
     dao = DaoBaseService()
     obj = dao.query(SqlConstants.QUERY_HTML_TAGS_BY_T_CRAWLER_ID % id)
     return CommonUtils.query_result_to_tags(obj)
Esempio n. 13
0
 def insert_t_crawler(self, parm):
     dao = DaoBaseService()
     return dao.insert_id(SqlConstants.INSERT_T_CRAWLER, parm)
Esempio n. 14
0
 def insert_html_tag(self, parm):
     dao = DaoBaseService()
     return dao.insert_id(SqlConstants.INSERT_HTML_TAGS, parm)