Permalink
Browse files

Replaced PlaceholderAdmin against PlaceholderAdminMixin in docs

  • Loading branch information...
1 parent 2aa7f69 commit ad2fc3f3591401deeb1325a617d5f600ddbe29d6 @jrief committed Feb 27, 2014
Showing with 19 additions and 10 deletions.
  1. +1 −0 CHANGELOG.txt
  2. +13 −10 docs/extending_cms/placeholders.rst
  3. +5 −0 docs/upgrade/3.0.rst
View
@@ -188,6 +188,7 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2
- moved apphooks from title to page model so we need to add them only once.
- request.current_app has been removed.
- added a namespace field, reverse_id is not used anymore for apphook namespaces.
+- PlaceholderAdmin is deprecated and available as mixin class renamed to PlaceholderAdminMixin.
- PlaceholderAdmin does not have LanguageTabs anymore. It only has a PluginAPI now.
- PageAdmin uses the same Plugin API as PlaceholderAdmin
- Toolbar API for your own apps added
@@ -69,17 +69,19 @@ Admin Integration
.. versionchanged:: 3.0
-If you install this model in the admin application, you have to use
-:class:`~cms.admin.placeholderadmin.PlaceholderAdmin` instead of
-:class:`~django.contrib.admin.ModelAdmin` so the interface renders
+If you install this model in the admin application, you have to use the mixin
+:class:`~cms.admin.placeholderadmin.PlaceholderAdminMixin` together with
+:class:`~django.contrib.admin.ModelAdmin` so that the interface renders
correctly::
from django.contrib import admin
- from cms.admin.placeholderadmin import PlaceholderAdmin
+ from cms.admin.placeholderadmin import PlaceholderAdminMixin
from myapp.models import MyModel
- admin.site.register(MyModel, PlaceholderAdmin)
+ class MyModelAdmin(PlaceholderAdminMixin, admin.ModelAdmin):
+ pass
+ admin.site.register(MyModel, MyModelAdmin)
.. warning::
@@ -92,8 +94,9 @@ correctly::
I18N Placeholders
=================
-Out of the box :class:`~cms.admin.placeholderadmin.PlaceholderAdmin` supports multiple languages and will
-display language tabs. If you extend `PlaceholderAdmin` and overwrite `change_form_template` be sure to have a look at
+Out of the box :class:`~cms.admin.placeholderadmin.PlaceholderAdminMixin` supports multiple
+languages and will display language tabs. If you extend yout model admin class derived from
+`PlaceholderAdminMixin` and overwrite `change_form_template` be sure to have a look at
'admin/placeholders/placeholder/change_form.html' on how to display the language tabs.
If you need other fields then the placeholders translated as well: django CMS has support for `django-hvad`_. If you
@@ -109,15 +112,15 @@ use a `TranslatableModel` model be sure to not include the placeholder fields in
def __unicode__(self):
return self.title
-Be sure to combine both hvad's :class:`TranslatableAdmin` and :class:`~cms.admin.placeholderadmin.PlaceholderAdmin` when
+Be sure to combine both hvad's :class:`TranslatableAdmin` and :class:`~cms.admin.placeholderadmin.PlaceholderAdminMixin` when
registering your model with the admin site::
- from cms.admin.placeholderadmin import PlaceholderAdmin
+ from cms.admin.placeholderadmin import PlaceholderAdminMixin
from django.contrib import admin
from hvad.admin import TranslatableAdmin
from myapp.models import MultilingualExample1
- class MultilingualModelAdmin(TranslatableAdmin, PlaceholderAdmin):
+ class MultilingualModelAdmin(TranslatableAdmin, PlaceholderAdminMixin, admin.ModelAdmin):
pass
admin.site.register(MultilingualExample1, MultilingualModelAdmin)
View
@@ -256,6 +256,11 @@ Details can be found in :ref:`multi_apphook`.
``PlaceholderAdmin``
====================
+``PlaceholderAdmin`` now is deprecated. Instead of deriving from ``admin.ModelAdmin``, a new mixin
+class ``PlaceholderAdminMixin`` has been introduced which shall be used together with ``admin.ModelAdmin``.
+Therefore when defining a model admin class containing a placeholder, now add ``PlaceholderAdminMixin``
+to the list of parent classes together with ``admin.ModelAdmin``.
+
``PlaceholderAdmin`` doesn't have language tabs anymore and the plugin editor is gone.
The plugin API has changed and is now more consistent. ``PageAdmin`` uses the
same API as ``PlaceholderAdmin`` now. If your app talked with the Plugin API

0 comments on commit ad2fc3f

Please sign in to comment.