Skip to content

Instantly share code, notes, and snippets.

@creimers
Last active April 22, 2016 16:24
Show Gist options
  • Save creimers/f72e947db79ab60a58de7c854a9e13e2 to your computer and use it in GitHub Desktop.
Save creimers/f72e947db79ab60a58de7c854a9e13e2 to your computer and use it in GitHub Desktop.
RelatedObjectDoesNotExist: Page has no publisher_draft.
from cms.models import Page
pages = Page.objects.all()
ids = [page.id for page in pages if page.get_absolute_url()=='/mitmachen/das-kannst-du-tun/']
one = ids[0]
two = ids[1]
one.publisher_public = two
one.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment