Added locations app
Moved contacts to new model
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from setup_django import *
|
||||
|
||||
from coord.models import Suburb as OldSuburb
|
||||
from common.models import Suburb as NewSuburb
|
||||
|
||||
created = 0
|
||||
skipped = 0
|
||||
|
||||
for old in OldSuburb.objects.all():
|
||||
|
||||
obj, was_created = NewSuburb.objects.get_or_create(
|
||||
id=old.id,
|
||||
defaults={
|
||||
"name": old.name,
|
||||
"state": old.state,
|
||||
"postcode": old.postcode,
|
||||
"distance": old.distance,
|
||||
}
|
||||
)
|
||||
|
||||
if was_created:
|
||||
created += 1
|
||||
else:
|
||||
skipped += 1
|
||||
|
||||
print(f"Created: {created}, Skipped: {skipped}")
|
||||
Reference in New Issue
Block a user