Created
January 7, 2017 16:33
-
-
Save zztalker/50044aa7178f39ae194df9c209d9829a to your computer and use it in GitHub Desktop.
example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = file.readline() | |
for e in file.readlines(): | |
l = e.split('\t') | |
row = db.docs(doc_id=l[0]) | |
if not row: | |
db.docs.insert(doc_id=l[0],type_doc1=l[1],type_doc2=l[2],type_doc3=l[3], | |
surname1 = l[4], name1 = l[5], patronymic1 = l[6], | |
surname2 = l[7], name2 = l[8], patronymic2 = l[9]) | |
rec = db.doc_status.insert(doc_id=l[0],status=l[10],status_ex=l[11],date_change=l[12]) | |
else: | |
row.update_record(type_doc1=l[1],type_doc2=l[2],type_doc3=l[3], | |
surname1 = l[4], name1 = l[5], patronymic1 = l[6], | |
surname2 = l[7], name2 = l[8], patronymic2 = l[9]) | |
rec = db.doc_status(doc_id=l[0]) | |
if not rec: | |
db.doc_status.insert(doc_id=l[0],status=l[10],status_ex=l[11],date_change=l[12]) | |
else: | |
rec.update_record(status=l[10],status_ex=l[11],date_change=l[12]) | |
response.flash = "Данные загружены!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment