예제 #1
0
 def crawl_get_all_for_site(self, site_id):
     entities = []
     conn = engine.connect()
     cmd = select([crawls]).where(crawls.c.site_id == site_id)
     rp = conn.execute(cmd)
     for record in rp:
         e = Crawl()
         e.load_from_rs(record)
         entities.append(e)
     conn.close()
     return entities
예제 #2
0
 def crawl_get_last_for_site(self, site_id):
     conn = engine.connect()
     cmd = select([crawls]).where(crawls.c.site_id == site_id).order_by(
         desc(crawls.c.date))
     record = conn.execute(cmd).first()
     e = None
     if not record == None:
         e = Crawl()
         e.load_from_rs(record)
     conn.close()
     return e