Skip to content

Commit

Permalink
Updates documentation section
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoistinen committed Aug 12, 2015
1 parent 151e78b commit 1c6535c
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions docs/how_to/custom_plugins.rst
Expand Up @@ -70,9 +70,51 @@ And so to build your plugin, you'll make it from:
A note about :class:`cms.plugin_base.CMSPluginBase`
===================================================

:class:`cms.plugin_base.CMSPluginBase` is actually a subclass of :class:`django.contrib.admin.options.ModelAdmin`.
:class:`cms.plugin_base.CMSPluginBase` is actually a subclass of
:class:`django.contrib.admin.options.ModelAdmin`.

A CMSPlugin's :meth:`render` method is analogous to a ModelAdmin's
:meth:`get_context` method.

Because :class:`CMSPluginBase` subclasses `ModelAdmin` several important
`ModelAdmin` options are also available to CMS plugin developers. These options
are often used:

* `exclude`,
* `fields`,
* `fieldsets`,
* `form`,
* `formfield_overrides`,
* `inlines`,
* `radio_fields`,
* `raw_id_fields`,
* `readonly_fields`.

Please note, however, that not all `ModelAdmin` options are effective in a CMS
plugin. In particular, any options that are used exclusively by the
`ModelAdmin`'s `changelist` will have no effect. These and other notable options
that are ignored by the CMS are:

* `actions`,
* `actions_on_top`,
* `actions_on_bottom`,
* `actions_selection_counter`,
* `date_hierarchy`,
* `list_display`,
* `list_display_links`,
* `list_editable`,
* `list_filter`,
* `list_max_show_all`,
* `list_per_page`,
* `ordering`,
* `paginator`,
* `preserve_fields`,
* `save_as`,
* `save_on_top`,
* `search_fields`,
* `show_full_result_count`,
* `view_on_site`.

It is its :meth:`render` method that is the plugin's **view** function.

An aside on models and configuration
====================================
Expand Down

0 comments on commit 1c6535c

Please sign in to comment.