Anonymous avatar Anonymous committed 27a36fa Draft Merge

merge django-cms-2.4

Comments (0)

Files changed (2)

semanticeditor/models.py

 from django.db import models
 from semanticeditor.fields import MultiSelectField
-from django.conf import settings
 
+# in django CMS 2.4, settings.CMS_TEMPLATE_INHERITANCE_MAGIC is unavailable
+try:
+    from django.conf import settings
+    template_list = [(f,n) for (f,n) in settings.CMS_TEMPLATES if f != settings.CMS_TEMPLATE_INHERITANCE_MAGIC]
 
-template_list = [(f,n) for (f,n) in settings.CMS_TEMPLATES if f != settings.CMS_TEMPLATE_INHERITANCE_MAGIC]
+except AttributeError:
+    import cms.constants
+    template_list = [(f,n) for (f,n) in settings.CMS_TEMPLATES if f != cms.constants.TEMPLATE_INHERITANCE_MAGIC]    
 
 
 class CssClassCategory(models.Model):

semanticeditor/views.py

 except ImportError:
     from django.utils.functional import wraps  # Python 2.3, 2.4 fallback.
 
+# in django CMS 2.4, settings.CMS_TEMPLATE_INHERITANCE_MAGIC is unavailable
+try:
+    TEMPLATE_INHERITANCE_MAGIC = settings.CMS_TEMPLATE_INHERITANCE_MAGIC
+except AttributeError:
+    import cms.constants
+    TEMPLATE_INHERITANCE_MAGIC = cms.constants.TEMPLATE_INHERITANCE_MAGIC
+
 
 def json_view(func):
     """
 def retrieve_styles(request):
     template = request.GET['template']
     page_id = request.GET['page_id']
-    if template == settings.CMS_TEMPLATE_INHERITANCE_MAGIC:
+    if template == TEMPLATE_INHERITANCE_MAGIC:
         # Need to look up page to find out what template to use
         p = Page.objects.get(pk=page_id)
         template = p.get_template()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.