Added locations app

Moved contacts to new model
This commit is contained in:
st01765
2026-02-26 13:34:32 +11:00
parent a24daed8f6
commit 4025c28eae
25 changed files with 576 additions and 75 deletions
@@ -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}")