这是我的模型:
class Company(models.Model):
id = models.AutoField(primary_key=True);
name = models.CharField(max_length=100);
address = models.CharField(max_length=100, null=True);
city = models.CharField(max_length=100);
state = models.CharField(max_length=25);
zip = models.IntegerField();
latitude = models.CharField(max_length=20, null=True)
longitude = models.CharField(max_length=20, null=True)
phone = models.CharField(max_length=15, null=True);
website = models.CharField(max_length=50, null=True);
email = models.EmailField(max_length=50, null=True);
hiring = models.BooleanField(default=False);
approved = models.BooleanField(default=False);
date_added = models.DateTimeField(auto_now_add=True);
about_us = models.TextField(max_length=500, null=True);
我有这样的数据:
Id: since this is autofield, do i need to enter this?
Name: 1-800 Postcards America's Printing Company
Address: 121 Varick Street, 7th Floor
City: New York
State: NY
Zip: 10013
Latitude: 40.724831999999999
Longitude: -74.00609
Phone: 212-741-1070
Website: http://www.1800postcards.com
Email: info@1800postcards.com
Hiring: No
Approved: True
Date Added: auto added as well, should I add a random date?
About Us: Some about us with, many, commas, possible, etc.
我需要将大约 50 多家使用 django 的公司上传到 gae 数据存储。如何创建 csv 文件以确保数据正确插入?