-
Notifications
You must be signed in to change notification settings - Fork 0
Home
John Heasly edited this page Feb 13, 2018
·
13 revisions
(Coming back to this months later, I think this is the quick-and-dirty, first pass listing of steps, so I didn't forget.)
- loaddata
auth.user.json
- loaddata
entity.json
(requires search & replace) - loaddata
location.json
(requires search & replace) - loaddata
munged_schedule_event.json
(output ofjson_transformer.py
) - create the necessary slugs (because they don't exist in
civic_calendar
... ) - After importing
Entity
fixture import, had to re-create everyslug
(!), so ... :
from civic_calendar2.models import Entity
from django.utils.text import slugify
for e in Entity.objects.all():
slug = u'{0}-{1}'.format(e.jurisdiction.id, slugify(e.name))
e.slug = slug
e.save()
print u'{0} saved.'.format(slug)
(And I think this is the more fleshed-out step by step down here ... )
- Get your
Schedule.Event
/Civic_calendar.Meeting
house in order by first doing thescripts/json_transformer.py
munge dance, as you may haveEntity
and/orLocation
data that references uncreated/non-existentSchedule.Event
and/orUser
. - Log in to
civic_calendar
on livedjango110
server, use Django utilitydumpdata
to export fullcivic_calendar
andschedule
apps.
$ python manage.py dumpdata schedule --format=json --indent=2 --settings=django_root.settings.production > schedule.json
$ python manage.py dumpdata civic_calendar --format=json --indent=2 --settings=django_root.settings.production > civic_calendar.json
- Copy
schedule.json
andcivic_calendar.json
tocivic_calendar2/scripts
directory, cd down tocivic_calendar2/scripts
and runjson_transformer.py
-
cd
up todjango_root
and useloaddata
to import the resultingmunged_schedule_event.json
file. - Still using
civic_calendar
on livedjango110
server, use Django utilitydumpdata
to exportEntity
,Location
model data. Probably won't need to exportJursidiction
(unless there's been a new city/town added).
$ python manage.py dumpdata civic_calendar.entity --format=json --indent=2 --settings=django_root.settings.production > civic_calendar.entity.json
$ python manage.py dumpdata civic_calendar.location --format=json --indent=2 --settings=django_root.settings.production > civic_calendar.location.json
- Search and replace
civic_calendar.entity
withcivic_calendar2.entity
. - Search and replace
civic_calendar.location
withcivic_calendar2.location
. -
loaddata
into yourdjango111
civic_calendar2
app.