Skip to content

Instantly share code, notes, and snippets.

@philippeowagner
Created July 24, 2014 12:15
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 philippeowagner/629cb5cbc746ae7be54c to your computer and use it in GitHub Desktop.
Save philippeowagner/629cb5cbc746ae7be54c to your computer and use it in GitHub Desktop.
Use a ForeignKey to a django CMS page in your models. See also https://django-cms.readthedocs.org/en/2.4.3/extending_cms/fields.html for more info.
from django.db import models
from cms.models.fields import PageField
class MyModel(models.Model):
my_page = PageField()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment