-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_data.py
More file actions
27 lines (22 loc) · 885 Bytes
/
Copy pathcheck_data.py
File metadata and controls
27 lines (22 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
django.setup()
from apps.locations.models import Location as OldLocation
from apps.departments.models import Department as OldDept
from apps.assets.models import Location as NewLocation, Department as NewDept
print('=== OLD locations table (apps.locations) ===')
print('Count:', OldLocation.objects.count())
for l in OldLocation.objects.all():
print(f' ID={l.pk} name={l.name!r} parent={l.parent}')
print()
print('=== OLD departments table (apps.departments) ===')
print('Count:', OldDept.objects.count())
for d in OldDept.objects.all():
print(f' ID={d.pk} name={d.name!r}')
print()
print('=== NEW locations table (apps.assets) ===')
print('Count:', NewLocation.objects.count())
print()
print('=== NEW departments table (apps.assets) ===')
print('Count:', NewDept.objects.count())