Permalink
Browse files

Replaced PlaceholderAdmin against PlaceholderAdminMixin together with…

… admin.ModelAdmin
  • Loading branch information...
1 parent c0ff51a commit 2a2c66cc752d3f7076462dc1bacce0bc89afa9d3 @jrief committed Feb 27, 2014
Showing with 8 additions and 8 deletions.
  1. +2 −2 cms/admin/pageadmin.py
  2. +2 −2 cms/admin/static_placeholder.py
  3. +4 −4 cms/models/placeholdermodel.py
View
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from functools import wraps
import sys
-from cms.admin.placeholderadmin import PlaceholderAdmin
+from cms.admin.placeholderadmin import PlaceholderAdminMixin
from cms.plugin_pool import plugin_pool
from django.contrib.admin.helpers import AdminForm
@@ -87,7 +87,7 @@ def create_revision():
INITIAL_COMMENT = "Initial version."
-class PageAdmin(PlaceholderAdmin, ModelAdmin):
+class PageAdmin(PlaceholderAdminMixin, ModelAdmin):
form = PageForm
search_fields = ('title_set__slug', 'title_set__title', 'reverse_id')
revision_form_template = "admin/cms/page/history/revision_header.html"
@@ -1,9 +1,9 @@
from cms.models import StaticPlaceholder
from django.contrib import admin
-from cms.admin.placeholderadmin import PlaceholderAdmin
+from cms.admin.placeholderadmin import PlaceholderAdminMixin
-class StaticPlaceholderAdmin(PlaceholderAdmin):
+class StaticPlaceholderAdmin(PlaceholderAdminMixin, admin.ModelAdmin):
list_display = ('name', 'code', 'creation_method')
search_fields = ('name', 'code',)
exclude = ('creation_method',)
@@ -130,8 +130,8 @@ def _get_attached_fields(self):
for rel in self._meta.get_all_related_objects():
if issubclass(rel.model, CMSPlugin):
continue
- from cms.admin.placeholderadmin import PlaceholderAdmin
- if rel.model in admin.site._registry and isinstance(admin.site._registry[rel.model], PlaceholderAdmin):
+ from cms.admin.placeholderadmin import PlaceholderAdminMixin
+ if rel.model in admin.site._registry and isinstance(admin.site._registry[rel.model], PlaceholderAdminMixin):
field = getattr(self, rel.get_accessor_name())
if field.count():
self._attached_fields_cache.append(rel.field)
@@ -149,8 +149,8 @@ def _get_attached_field(self):
for rel in relations:
if issubclass(rel.model, CMSPlugin):
continue
- from cms.admin.placeholderadmin import PlaceholderAdmin
- if rel.model in admin.site._registry and isinstance(admin.site._registry[rel.model], PlaceholderAdmin):
+ from cms.admin.placeholderadmin import PlaceholderAdminMixin
+ if rel.model in admin.site._registry and isinstance(admin.site._registry[rel.model], PlaceholderAdminMixin):
field = getattr(self, rel.get_accessor_name())
if field.count():
self._attached_field_cache = rel.field

0 comments on commit 2a2c66c

Please sign in to comment.