refactor auto import

This commit is contained in:
hsafaei
2025-01-18 15:32:25 +03:30
parent a5da45d7a5
commit c1ef81c632
31 changed files with 1613 additions and 1123 deletions
+5 -5
View File
@@ -52,6 +52,7 @@ def import_regulation_section_update_ref_state(cursor):
'''
cursor.execute(query)
text_normal = TextNormalizer()
url = BASE_URL + "repo/majles/rgsection/multi/update"
@@ -127,16 +128,15 @@ def import_regulation_section_update_ref_state(cursor):
ref_state = {
"id" : row.id,
"qanon_id": efect_qanon_id,
"qanon_title" : normalYehKe(row.effect_qanon),
"qanon_title" : text_normal.normalize_qanon(row.effect_qanon),
"qanon_date": row.effect_Date,
"section_id": efect_section_id,
"section_title": normalYehKe(row.effect_section_title),
"ref_key": "qavanin",
"effect_type" : effect_type,
"new_text" : normalYehKe(row.effect_text),
"prev_text" : normalYehKe(row.effect_prev_text),
"description" : normalYehKe(row.description)
}
"new_text" : text_normal.normalize_qanon(row.effect_text),
"prev_text" : text_normal.normalize_qanon(row.effect_prev_text),
"description" : text_normal.normalize_qanon(row.description) }
if previd == eid :