Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed FrontendEditableAdmin to FrontendEditableAdminMixin for using…

… consistent terminology
  • Loading branch information...
commit 73f767cf7671880ce798b1db4fb73d11eb249fa8 1 parent c706fe7
Jacob Rief authored
4 cms/admin/placeholderadmin.py
View
@@ -35,7 +35,7 @@
from cms.utils.i18n import get_language_list
-class FrontendEditableAdmin(object):
+class FrontendEditableAdminMixin(object):
frontend_editable_fields = []
def get_urls(self):
@@ -51,7 +51,7 @@ def get_urls(self):
'',
pat(r'edit-field/([0-9]+)/([a-z\-]+)/$', self.edit_field),
)
- return url_patterns + super(FrontendEditableAdmin, self).get_urls()
+ return url_patterns + super(FrontendEditableAdminMixin, self).get_urls()
def _get_object_for_single_field(self, object_id, language):
# Quick and dirty way to retrieve objects for django-hvad
6 cms/test_utils/project/placeholderapp/admin.py
View
@@ -1,10 +1,10 @@
-from cms.admin.placeholderadmin import PlaceholderAdminMixin, FrontendEditableAdmin
+from cms.admin.placeholderadmin import PlaceholderAdminMixin, FrontendEditableAdminMixin
from cms.test_utils.project.placeholderapp.models import (Example1, MultilingualExample1, TwoPlaceholderExample)
from django.contrib import admin
from hvad.admin import TranslatableAdmin
-class ExampleAdmin(FrontendEditableAdmin, PlaceholderAdminMixin, admin.ModelAdmin):
+class ExampleAdmin(FrontendEditableAdminMixin, PlaceholderAdminMixin, admin.ModelAdmin):
frontend_editable_fields = ("char_1", "char_2")
@@ -12,7 +12,7 @@ class TwoPlaceholderExampleAdmin(PlaceholderAdminMixin, admin.ModelAdmin):
pass
-class MultilingualAdmin(FrontendEditableAdmin, TranslatableAdmin,
+class MultilingualAdmin(FrontendEditableAdminMixin, TranslatableAdmin,
PlaceholderAdminMixin, admin.ModelAdmin):
frontend_editable_fields = ("char_1", "char_2")
12 docs/extending_cms/frontend_models.rst
View
@@ -122,16 +122,16 @@ and the resulting forms.
Complete changeform edit
========================
-You need to properly setup your admin class by adding the
-``FrontendEditableAdmin`` mixin to the parents of your admin class (see
+You need to properly setup your admin class by adding the ``FrontendEditableAdminMixin``
+mixin to the parents of your admin class (see
:mod:`Django admin documentation <django.contrib.admin>` for further information)
on Django admin::
- from cms.admin.placeholderadmin import FrontendEditableAdmin
+ from cms.admin.placeholderadmin import FrontendEditableAdminMixin
from django.contrib import admin
- class MyModelAdmin(FrontendEditableAdmin, admin.ModelAdmin):
+ class MyModelAdmin(FrontendEditableAdminMixin, admin.ModelAdmin):
...
Then setup the templates adding ``render_model`` templatetag::
@@ -156,11 +156,11 @@ Set up the admin
You need to add to your model admin a tuple of fields editable from the frontend
admin::
- from cms.admin.placeholderadmin import FrontendEditableAdmin
+ from cms.admin.placeholderadmin import FrontendEditableAdminMixin
from django.contrib import admin
- class MyModelAdmin(FrontendEditableAdmin, admin.ModelAdmin):
+ class MyModelAdmin(FrontendEditableAdminMixin, admin.ModelAdmin):
frontend_editable_fields = ("foo", "bar")
...
Please sign in to comment.
Something went wrong with that request. Please try again.