Thanks!
For reference if someone else needs to do this, here’s a possible approach for Booktype 2.4. I’m not super at ease in the PostgreSQL shell so I opened the django django shell with e@booktype:/var/www/booktype/instance1$ sudo PYTHON_PATH=/var/lib/booktype/lib/python2.7 ./manage_prod.py shell
(not sure the PYTHON_PATH part is necessary, I must have messed up the path during installing). Then:
b = Book.objects.get(url_title='this-book')
def rename_chapter(old_slug, new_slug):
try:
c = Chapter.objects.filter(book=b).get(url_title=old_slug)
except Chapter.DoesNotExist:
print "%s not found" % old_slug
return
c.url_title = new_slug
c.save()
# repeat the following line as often as necessary
rename_chapter('the-name', '03-the-changed-name')
It looks like you're new here. If you want to get involved, click one of these buttons!