Added tonnes of features, lets see what breaks.

This commit is contained in:
root
2019-11-26 02:13:47 +01:00
parent ddbbfb5ee4
commit e2d75c3ea0
17 changed files with 500 additions and 102 deletions

View File

@@ -20,13 +20,18 @@ class Command(BaseCommand):
with transaction.atomic():
country = Country.objects.get(country='United Kingdom')
country = Country.objects.get(country="United States of America")
user = User.objects.first()
with open('/home/ubuntu/lat_lng.csv', 'r') as csvfile:
datareader = csv.reader(csvfile)
for row in datareader:
if row:
Coord.objects.create(lat=row[0], lng=row[1], country=country, user=user)
_,c = Coord.objects.get_or_create(
lat=row[0],
lng=row[1],
country=country,
user=user
)
if options['dry_run']:
transaction.set_rollback(True)