b695dd8054
Moved helpers and views to their respective new apps
24 lines
612 B
Python
24 lines
612 B
Python
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") |