def populate():
with open('sample-user-patches.csv') as csvfile:
rows = csv.DictReader(csvfile)
for row in rows:
person = Person.objects.get(id=row['person_id'])
patch = IssueResolverPatch.objects.create(
content_object=person,
jurisdiction_id=row['jurisdiction_id'],
status=row['status'],
old_value=row['old_value'],
new_value=row['new_value'],
category=row['category'],
alert=row['alert'],
note=row['note'],
source=row['source'],
reporter_name=row['reporter_name'],
reporter_email=row['reporter_email'],
applied_by=row['applied_by']
)
patch.save()
populate_issue_resolver_patches.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录