Created new models to replicate out of and split coord app

Moved helpers and views to their respective new apps
This commit is contained in:
st01765
2026-02-05 11:18:08 +11:00
parent ad4fd19cc7
commit b695dd8054
26 changed files with 1536 additions and 10 deletions
@@ -0,0 +1,24 @@
import os
import sys
import django
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Setup Django environment
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "busManager.settings")
django.setup()
from coord.models import Suburb as OldSuburb
from common.models import Suburb as NewSuburb
for old in OldSuburb.objects.all():
NewSuburb.objects.create(
id=old.id, # preserve PK
name=old.name,
state=old.state,
postcode=old.postcode,
distance=old.distance
)
print(f"Copied {OldSuburb.objects.count()} suburbs to common_suburb")