Commit 5422394d authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Change pipeline for save tags to db

parent 58b8b305
......@@ -21,10 +21,12 @@ class ExaPipeline(object):
item['title'] = ''.join(item['title']).replace('\n', ' ')
if item['description']:
item['description'] = ''.join(item['description']).replace('\n', ' ')
if item['tags']:
item['tags'] = ','.join(item['tags']).replace('\n', '')
data = (item['title'], item['description'], item['url'], item['media_id'], item['type_id'],
item['region_id'], item['post_id'], item['date'], datetime.now().date(), item['company_id'], 0)
item['region_id'], item['post_id'], item['date'], datetime.now().date(), item['company_id'], 0, item['tags'])
query = """INSERT INTO wp_esi_news_accept (title, description, URL, media_id, type_id, region_id, post_id,
publish_date, record_date, company_id, is_accepted) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);\n"""
publish_date, record_date, company_id, is_accepted, temp_tags) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);\n"""
if item['url'] in self.urls:
print("DUPLICATE", item)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment