def handle(self, *args, **options):
SalaryRecord.objects.all().delete()
clean_file_path = os.path.join(
settings.DATA_DIR, 'berkeley_faculty.csv')
fields = [field.name for field in SalaryRecord._meta.get_fields()
if field.name != 'id']
mapping = {field: field for field in fields}
c = CopyMapping(
SalaryRecord,
clean_file_path,
mapping
)
c.save()
importsalaryrecords.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录