This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gist provides an overview for page-changes in django-cms. | |
It prints out the changed plugins etc. for pages. | |
Note: This is not a 'diff-tool', so you won't see the exact changes, e.g. text-content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import http | |
from django.conf import settings | |
from django.core import urlresolvers | |
from django.core.exceptions import ImproperlyConfigured | |
from django.utils.deprecation import MiddlewareMixin | |
class AppendOrRemoveSlashMiddleware(MiddlewareMixin): | |
""" | |
This middleware removes a given trailing slash if the resulting path is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# anywhere_you_want.py | |
def create_plugins_from_cmsplugin(new_model_app, new_plugin_model_name, | |
new_plugin_name, apps=None): | |
""" | |
Create plugins for `new_plugin_name` from CMSPlugin-Plugins. This is | |
necessary if you add a model to a plugin which previously had none. | |
""" | |
if apps is None: | |
from django.apps.registry import apps as dj_apps | |
apps = dj_apps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.apps import apps as global_apps | |
from django.db import migrations | |
from djangocms_file.models import get_templates as get_file_templates | |
from djangocms_picture.models import get_templates as get_picture_templates | |
def forwards_filer_file(apps, schema_editor): | |
try: | |
CMSPluginFilerFile = apps.get_model('cmsplugin_filer_file', | |
'FilerFile') |