Skip to content
Browse files

Merge pull request #926 from ojii/feature/document-page-field

Added documentation for cms.forms.field.PageSelectFormField and cms.model
  • Loading branch information...
2 parents 73c3665 + 291817a commit 087bc7046476f87608c1545f1c614e8de8cbd4db @ojii ojii committed Aug 4, 2011
Showing with 33 additions and 0 deletions.
  1. +32 −0 docs/extending_cms/fields.rst
  2. +1 −0 docs/index.rst
View
32 docs/extending_cms/fields.rst
@@ -0,0 +1,32 @@
+#####################
+Form and model fields
+#####################
+
+
+************
+Model fields
+************
+
+
+.. py:class:: cms.models.fields.PageField
+
+ This is a foreign key field to the :class:`cms.models.pagemodel.Page` model
+ that defaults to the :class:`cms.forms.fields.PageSelectFormField` form
+ field when rendered in forms. It has the same API as the
+ :class:`django.db.models.fields.related.ForeignKey` but does not require
+ the ``othermodel`` argument.
+
+
+***********
+Form fields
+***********
+
+
+.. py:class:: cms.forms.fields.PageSelectFormField
+
+ Behaves like a :class:`django.forms.models.ModelChoiceField` field for the
+ :class:`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
+ :class:`django.forms.models.ModelChoiceField`.
View
1 docs/index.rst
@@ -54,6 +54,7 @@ Extending the CMS
extending_cms/api_references
extending_cms/placeholders
extending_cms/searchdocs
+ extending_cms/fields
***********************

0 comments on commit 087bc70

Please sign in to comment.
Something went wrong with that request. Please try again.