def updateProperty(prop): query = """ update property set url = '%s', crawled_at = '%s' where id = '%s' """ % (prop["url"], formatCurrentDate(), prop["id"]) db.executeUpdate(query)
def insertNewProperty(prop): query = """ insert into property (id, address, longitude, latitude, price, url, posted_at, crawled_at) values ('%s', '%s', %s, %s, %s, '%s', '%s', '%s') """ % (prop["id"], prop["address"], prop["longitude"], prop["latitude"], prop["price"], prop["url"], prop["posted_at"], formatCurrentDate()) db.executeUpdate(query)