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:
@@ -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")
|
||||
Reference in New Issue
Block a user