Skip to content

Instantly share code, notes, and snippets.

@fmartingr
Created December 4, 2013 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmartingr/7786765 to your computer and use it in GitHub Desktop.
Save fmartingr/7786765 to your computer and use it in GitHub Desktop.
Fixes for certain projects
def fix_contentype_pages():
"""
Fix admin recent history name value for django-cms pages
"""
from django.contrib.contenttypes.models import ContentType
items = ContentType.objects.filter(model='page', name='', app_label='cms')
for item in items:
item.name = 'page'
item.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment