Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from apps.companies.models import Company
- import csv
- csvfile = open('/home/app/tmp/Companies-description-with-keywords.csv', newline='')
- datareader = csv.reader(csvfile, delimiter=',', quotechar='"')
- data = []
- for row in datareader:
- data.append([row[0], row[2]])
- for i in data:
- c = Company.objects.get(id=i[0])
- c.description = i[1]
- c.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement