Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added documentation for cms.forms.field.PageSelectFormField and cms.model #926

Merged
merged 5 commits into from

3 participants

@ojii
Collaborator

Added documentation for cms.forms.field.PageSelectFormField and cms.models.fields.PageField, fixes #904

@kezabelle

"that defaults to using" instead of "that defaults to use"?

You dont even need "using" "default to" is fine on its own.

@kezabelle

"splitted" should probably just be "split".

as above ^

@crooksey

If we are being picky, "This takes" as its the start of a new sentence.

@crooksey

Looks good.

*LGTM as per ojji ;)

@kezabelle

LGTM too.

@ojii ojii merged commit 087bc70 into divio:develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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
***********************
Something went wrong with that request. Please try again.