7. Form and model fields

7.1. Model fields

class cms.models.fields.PageField

This is a foreign key field to the cms.models.pagemodel.Page model that defaults to the cms.forms.fields.PageSelectFormField form field when rendered in forms. It has the same API as the django.db.models.fields.related.ForeignKey but does not require the othermodel argument.

7.2. Form fields

class cms.forms.fields.PageSelectFormField

Behaves like a django.forms.models.ModelChoiceField field for the cms.models.pagemodel.Page model, but displays itself as a split field with a select dropdown for the site and one for the page. It also indents the page names based on what level they’re on, so that the page select dropdown is easier to use. This takes the same arguments as django.forms.models.ModelChoiceField.

Project Versions

Table Of Contents

Previous topic

6. Search and the django CMS

Next topic

8. Testing Your Extenstions

This Page