Git Product home page Git Product logo

djangocms-cascade's Introduction

djangocms-cascade

Build Status PyPI version Django versions Python versions Software license

The Swiss army knife for working with Django-CMS plugins.

Why Use DjangoCMS-Cascade?

DjangoCMS-Cascade is a collection of plugins for Django-CMS placeholders. Instead of creating one database model for each CMS plugin, Cascade shares one database model for all of them. The payload then is stored inside a JSON field instead of declaring each attribute explicitly. This furthermore prevents us to handle all kind of nasty database migration problems.

Features

Perfect for nested grid systems

Since Cascade keeps track on the widths of all columns, <img> and <picture> elements can be rendered in a responsive way, so that the browser only loads the image required for the visible viewport.

Extend plugins with additional features

Using a JSON field to store the payload gives us much more flexibility. We can for instance enrich our plugins with additional attributes, configured during runtime. This can be used to optionally share attributes across different plugins (referenced by an alias name), add CSS classes and styles, or offer alternative rendering templates.

Set links onto your own views

Another nice aspect of this approach is, that we can override the functionality used to set links onto pages which are not part of the CMS. This is specially useful, since we do not want to re-implement this functionality for all plugins, which require links, ie. images, pictures, buttons and text-links.

Copy content and paste it somewhere else

Since the payload of plugins is already serialized, we can even copy them from one site to another site supporting djangocms-cascade.

Documentation

Find detailed documentation on ReadTheDocs.

Please see the Release Notes before upgrading from an older version.

Architecture

It's pluggable

DjangoCMS-Cascade is very modular, keeping its CMS modules in functional groups. These groups have to be activated independently in the project's settings.py. It also is possible to activate only certain plugins out of a group. Currently Bootstrap-4 is implemented, but this app could easily be extended for other CSS frameworks.

Configurable individually

Each Cascade plugin can be styled individually. The site-administrator can specify which CSS styles and CSS classes can be added to each plugin. Then the page-editor can pick one of the allowed styles to adopt his elements accordingly.

Reuse your data

Each Cascade plugin can be configured by the site-administrator to share some or all of its data fields. This for instance is handy, to keep references onto external URLs in a central place. Or is can be used to resize all images sharing a cetrain property in one go.

Segment the DOM

It is even possible to group plugins into seperate evaluation contexts. This for instance is used to render different Plugins, depending on whether a user is authenticated or anonymous.

Responsive Images

In modern web development, images must adopt to the column width in which they are rendered. Therefore the <img ...> tag, in addition to the well known src attribute, also accepts additional srcset's, one for each media query. Here djangocms-cascade calculates the required widths for each image, depending on the current column layout considering all media breakpoints.

This is also implemented for the <picture> element with all of it's children, normally <source srcset="...">.

It also supports resolutions of more than one physical pixel per logical pixel as found in Retina displays.

Other Features

  • Use the scaffolding technique from the preferred CSS framework to subdivide a placeholder into a grid system.
  • Make full usage of responsive techniques, by allowing stacked to horizontal classes per element.
  • Use styled buttons to add links.
  • Wrap special content into a Jumbotron or a Carousel.
  • Add <img> and <picture> elements in a responsive way, so that more than one image URL points onto the resized sources, one for each viewport using the srcset tags or the <source> elements.
  • Use segmentation to conditionally render parts of the DOM.
  • Temporarily hide a plugin to show up in the DOM.
  • Upload an self composed font from Fontello and use it's icon in plain text or as framed eye catchers.
  • It is very easy to integrate additional elements from the preferred CSS framework. For instance, implementing the Bootstrap Carousel, requires only 50 lines of Python code and two simple Django templates.
  • Since all the data is stored in JSON, no database migration is required if a field is added, modified or removed from the plugin.
  • Currently Bootstrap-4 is supported, but other CSS frameworks can be easily added in a pluggable manner.
  • It follows the "batteries included" philosophy, but still remains very modular.

In addition to easily implement any kind of plugin, DjangoCMS-Cascade makes it possible to add reusable helpers. Such a helper enriches a plugin with an additional, configurable functionality:

  • By making some of the plugin fields sharable, one can reuse these values for other plugins of the same kind. This for instance is handy for the image and picture plugin, so that images always are resized to predefined values.
  • By allowing extra fields, one can add an optional id tag, CSS classes and inline styles. This is configurable on a plugin and site base.
  • It is possible to customize the rendering templates shipped with the plugins.
  • Since all data is JSON, you can dump the content of one placeholder and insert it into another one, even on a foreign site. This for instance is useful to transfer pages from the staging site to production.

Help appreciated

If someone wants to start a subproject for a CSS framework, other than Bootstrap-4/5.

If you are a native English speaker, please check the documentation for spelling mistakes and grammar, since English is not my mother tongue.

Twitter

djangocms-cascade's People

Contributors

adentintime avatar aditnryn avatar adrien-delhorme avatar asmaps avatar beniwohli avatar bittner avatar czpython avatar db654 avatar digi604 avatar electroniceagle avatar execut avatar fp4code avatar frnhr avatar gentleshark avatar haricot avatar jotielim avatar jrief avatar julien-blanc avatar julienp avatar kernom avatar manuelweiss avatar ojii avatar patchwork-systems avatar pcolmant avatar perplexa avatar retailify avatar rfleschenberg avatar sniku avatar swildermann avatar zanderle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

djangocms-cascade's Issues

Enable usage of arbitrary plugins inside containers

Currently, I dont see a way to enable custom or 3rd party plugins to be addable to, for example, a column plugin.

If I read the source correctly, the choices are hardcoded as of now.
Eg. generic_child_classes = ('TextPlugin', 'FilerImagePlugin',) in BootstrapColumnPlugin.

Am I missing something?

Endless migration generation in Django 1.7

I have encountered a problem in which I can't run ./manage.py migrate in my application because Django constantly detects there are unmigrated changes in cmsplugin_cascade. The only differences in each of these migrations appears to be the ordering of the list of choices related to model_name='pluginextrafields'. For example, here are migrations 0002, 0003, and 0004 that are generated in my project for cmsplugin_cascade.

0002_auto_20150429_1310:

class Migration(migrations.Migration):

    dependencies = [
        ('cmsplugin_cascade', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='pluginextrafields',
            name='plugin_type',
            field=models.CharField(db_index=True, max_length=50, verbose_name='Plugin Name', choices=[(b'BootstrapButtonPlugin', 'Bootstrap Button'), (b'SimpleWrapperPlugin', 'Bootstrap Simple Wrapper'), (b'HorizontalRulePlugin', 'Bootstrap Horizontal Rule'), (b'BootstrapRowPlugin', 'Bootstrap Row')]),
            preserve_default=True,
        ),
    ]

0003_auto_20150429_1346:

class Migration(migrations.Migration):

    dependencies = [
        ('cmsplugin_cascade', '0002_auto_20150429_1310'),
    ]

    operations = [
        migrations.AlterField(
            model_name='pluginextrafields',
            name='plugin_type',
            field=models.CharField(db_index=True, max_length=50, verbose_name='Plugin Name', choices=[(b'HorizontalRulePlugin', 'Bootstrap Horizontal Rule'), (b'BootstrapButtonPlugin', 'Bootstrap Button'), (b'BootstrapRowPlugin', 'Bootstrap Row'), (b'SimpleWrapperPlugin', 'Bootstrap Simple Wrapper')]),
            preserve_default=True,
        ),
    ]

0004_auto_20150429_1346.py:

class Migration(migrations.Migration):

    dependencies = [
        ('cmsplugin_cascade', '0003_auto_20150429_1346'),
    ]

    operations = [
        migrations.AlterField(
            model_name='pluginextrafields',
            name='plugin_type',
            field=models.CharField(db_index=True, max_length=50, verbose_name='Plugin Name', choices=[(b'HorizontalRulePlugin', 'Bootstrap Horizontal Rule'), (b'SimpleWrapperPlugin', 'Bootstrap Simple Wrapper'), (b'BootstrapRowPlugin', 'Bootstrap Row'), (b'BootstrapButtonPlugin', 'Bootstrap Button')]),
            preserve_default=True,
        ),
    ]

These are only the first three migrations I generated. As far as I can tell, it will keep doing this endlessly. This problem is occurring after an upgrade to Django 1.7.7 and djangocms-cascade 0.4.4. I never observed this problem when working with Django 1.6.x and djangocms-cascade 0.4.3. Is this a known bug or perhaps a problem with my cascade configuration? Thanks.

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet

I cannot get "djangocms-cascade 0.4.0" to work on Django CMS 3.0.7 with Django 1.7.1.

Environment

  • Ubuntu 14.04 Server 64-bit
  • Python 2.7.6
  • Django 1.7.1
  • Django CMS 3.0.7 (installed via djangocms-installer)

Prior to applying the "djangocms-cascade" specific settings, I verified that Django CMS is working.

Installed "djangocms-cascade 0.4.0" with below command:

pip install git+https://github.com/jrief/[email protected]

pip freeze

(env)vagrant@vagrant-ubuntu-trusty-64:~/workspace$ pip freeze
Django==1.7.1
Django-Select2==4.2.2
Pillow==2.6.1
South==1.0.1
Unidecode==0.04.16
argparse==1.2.1
beautifulsoup4==4.3.2
dj-database-url==0.3.0
django-appconf==0.6
django-bootstrap3==5.0.2
django-classy-tags==0.5.1
django-cms==3.0.7
django-dbbackup==2.0.4
django-filer==0.9.8
django-mptt==0.6.1
django-polymorphic==0.6
django-reversion==1.8.5
django-sekizai==0.7
djangocms-admin-style==0.2.3
djangocms-cascade==0.4.0-alpha
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.1
djangocms-googlemap==0.2
djangocms-inherit==0.1
djangocms-installer==0.6.0
djangocms-link==1.5
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.4.1
djangocms-video==0.1
easy-thumbnails==2.2
ecdsa==0.11
html5lib==0.999
jsonfield==1.0.0
paramiko==1.15.1
psycopg2==2.5.4
pycrypto==2.6.1
pyflakes==0.8.1
pysftp==0.2.8
pytz==2014.10
requests==2.5.0
six==1.8.0
wsgiref==0.1.2

"djangocms-cascade" specific settings in the "settings.py"

INSTALLED_APPS = (
...
'cmsplugin_cascade',
# 'cmsplugin_cascade.sharable',
'cms',
...
)
CMS_CASCADE_PLUGINS = ('cmsplugin_cascade.bootstrap3',)

Error when running 'makemigrations' or 'migrate'

(env)vagrant@vagrant-ubuntu-trusty-64:~/workspace$ python manage.py makemigrations
/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/publisher/manager.py:5: RemovedInDjango18Warning: `PublisherManager.get_query_set` method should be renamed `get_queryset`.
  class PublisherManager(models.Manager):

/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/models/managers.py:15: RemovedInDjango18Warning: `PageManager.get_query_set` method should be renamed `get_queryset`.
  class PageManager(PublisherManager):

/home/vagrant/workspace/env/local/lib/python2.7/site-packages/djangocms_googlemap/forms.py:14: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form GoogleMapForm needs updating
  class GoogleMapForm(ModelForm):

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cmsplugin_cascade/models.py", line 23, in <module>
    class PluginExtraFields(models.Model):
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cmsplugin_cascade/models.py", line 28, in PluginExtraFields
    CUSTOMIZABLE_PLUGINS = _plugins_for_site()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cmsplugin_cascade/models.py", line 19, in _plugins_for_site
    cascade_plugins = set([p for p in plugin_pool.get_all_plugins() if issubclass(p, ExtraFieldsMixin)])
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/plugin_pool.py", line 217, in get_all_plugins
    self.discover_plugins()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/plugin_pool.py", line 36, in discover_plugins
    load('cms_plugins')
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/utils/django_load.py", line 56, in load
    get_module(app, modname, verbose, failfast)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/utils/django_load.py", line 40, in get_module
    module = import_module(module_name)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/utils/importlib.py", line 46, in import_module
    __import__(name)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/djangocms_inherit/cms_plugins.py", line 13, in <module>
    from .forms import InheritForm
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/djangocms_inherit/forms.py", line 11, in <module>
    class InheritForm(ModelForm):
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/djangocms_inherit/forms.py", line 13, in InheritForm
    label=_("page"), queryset=Page.objects.drafts(), required=False)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/models/managers.py", line 26, in drafts
    return super(PageManager, self).drafts()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/cms/publisher/manager.py", line 14, in drafts
    return self.filter(publisher_is_draft=True)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 691, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 709, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1287, in add_q
    clause, require_inner = self._add_q(where_part, self.used_aliases)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1314, in _add_q
    current_negated=current_negated, connector=connector)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1138, in build_filter
    lookups, parts, reffed_aggregate = self.solve_lookup_type(arg)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1076, in solve_lookup_type
    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1339, in names_to_path
    field, model, direct, m2m = opts.get_field_by_name(name)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/options.py", line 416, in get_field_by_name
    cache = self.init_name_map()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/options.py", line 445, in init_name_map
    for f, model in self.get_all_related_m2m_objects_with_model():
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/options.py", line 563, in get_all_related_m2m_objects_with_model
    cache = self._fill_related_many_to_many_cache()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/db/models/options.py", line 577, in _fill_related_many_to_many_cache
    for klass in self.apps.get_models():
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/utils/lru_cache.py", line 101, in wrapper
    result = user_function(*args, **kwds)
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 168, in get_models
    self.check_models_ready()
  File "/home/vagrant/workspace/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 131, in check_models_ready
    raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.
(env)vagrant@vagrant-ubuntu-trusty-64:~/workspace$ 

Research

The problem might to be related to this...
https://docs.djangoproject.com/en/dev/releases/1.7/#standalone-scripts

djangocms-cascade version 0.4.0 about to be released soon

In a huge effort, I refactored to code last week.

New features:

  • Now <img> and <picture> are controlled by separate plugins.
  • You can add any extra field of your choice, just by enabling this feature per plugin and then configuring it in the backend. See docs for details.
  • You can allow any field from any plugin to be sharable by a simple configuration option. See docs for details.

The code base now is much cleaner and I am looking forward to release it as soon as DjangoCMS-3.0.8 is out. Currently you have to use this branch https://github.com/divio/django-cms/tree/support/3.0.x because while writing this plugin, I found and fixed a bug in DjangoCMS.

Unfortunately this also changed the code base quite a lot, according to git diff --stat, 58 files changed, 1094 insertions(+), 772 deletions(-)
Be prepared that the API changed and therefore don't pull it, if you use the 0.4.0 branch in a productive environment.

Please test and give me feedback.

Jacob

When front-end editing (adding or adding rows for example) I get Internal server error

Whenever I do front-end editing, I get 500 error, saying

The following error occured: RegistrationError at /en/admin/cms/page/add-plugin/ has not been registered with django-reversion Request Method: POST Request URL: http://localhost:8000/en/admin/cms/page/add-plugin/

The adding/editing still happens, but I get a notification and I can see it in the logs. Any ideas what is this?

ImproperlyConfigured: Plugin buttons as specified in cmsplugin_cascade.bootstrap3.settings.CMSPLUGIN_CASCADE_PLUGINS could not be loaded: cannot import name LinkSelectFormField

Just debugging this now.

$ make test
./manage.py test --noinput 2>&1 | tee unittest.log
Got an error creating the test database: database "test_site_awesim" already exists

/Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/cms_plugins.py:18: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  raise ImproperlyConfigured(msg.format(p, module, err.message))

Creating test database for alias 'default'...
Destroying old test database 'default'...
Traceback (most recent call last):
  File "./manage.py", line 18, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/south/management/commands/test.py", line 8, in handle
    super(Command, self).handle(*args, **kwargs)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/test/runner.py", line 145, in run_tests
    old_config = self.setup_databases()
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/test/runner.py", line 107, in setup_databases
    return setup_databases(self.verbosity, self.interactive, **kwargs)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/test/runner.py", line 279, in setup_databases
    verbosity, autoclobber=not interactive)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/db/backends/creation.py", line 339, in create_test_db
    load_initial_data=False)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/__init__.py", line 159, in call_command
    return klass.execute(*args, **defaults)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/base.py", line 284, in execute
    self.validate()
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/base.py", line 310, in validate
    num_errors = get_validation_errors(s, app)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/core/management/validation.py", line 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors
    self._populate()
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _populate
    self.load_app(app_name, True)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
    models = import_module('%s.models' % app_name)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/models.py", line 63, in <module>
    class PluginExtraFields(models.Model):
  File "/Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/models.py", line 73, in PluginExtraFields
    CUSTOMIZABLE_PLUGINS = _plugins_for_site()
  File "/Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/models.py", line 59, in _plugins_for_site
    cascade_plugins = set([p for p in plugin_pool.get_all_plugins() if issubclass(p, ExtraFieldsMixin)])
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/cms/plugin_pool.py", line 217, in get_all_plugins
    self.discover_plugins()
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/cms/plugin_pool.py", line 36, in discover_plugins
    load('cms_plugins')
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/cms/utils/django_load.py", line 56, in load
    get_module(app, modname, verbose, failfast)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/cms/utils/django_load.py", line 40, in get_module
    module = import_module(module_name)
  File "/Users/bschott/.virtualenvs/site-awesim/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/cms_plugins.py", line 18, in <module>
    raise ImproperlyConfigured(msg.format(p, module, err.message))
django.core.exceptions.ImproperlyConfigured: Plugin buttons as specified in cmsplugin_cascade.bootstrap3.settings.CMSPLUGIN_CASCADE_PLUGINS could not be loaded: cannot import name LinkSelectFormField
[site-awesim] bschott@ironman-2 ~/Source/site-awesim (feature/3TSc9Kab/48-upgrade-critical-requirements) 
$ ./manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: database "test_site_awesim" already exists

Type 'yes' if you would like to try deleting the test database 'test_site_awesim', or 'no' to cancel: yes
Destroying old test database 'default'...
> /Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/cms_plugins.py(14)<module>()
-> for p in module_plugins:
(Pdb) module_plugins
(u'buttons', u'carousel', u'collapse', u'container', u'wrappers', u'image', u'picture')
(Pdb) n
> /Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/cms_plugins.py(15)<module>()
-> try:
(Pdb) p     
*** SyntaxError: SyntaxError('unexpected EOF while parsing', ('<string>', 0, 0, ''))
(Pdb) print p
buttons
(Pdb) n
> /Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/cms_plugins.py(16)<module>()
-> import_module('{}.{}'.format(module, p))
(Pdb) n
ImportError: 'cannot import name LinkSelectFormField'
> /Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/cms_plugins.py(16)<module>()
-> import_module('{}.{}'.format(module, p))
(Pdb) p module
'cmsplugin_cascade.bootstrap3'
(Pdb) p p
u'buttons'
(Pdb) from cmsplugin_cascade.bootstrap3 import buttons
*** ImportError: cannot import name LinkSelectFormField
(Pdb) 

Cannot copy a column in frontend

I am not sure what happens, but when I copy a column, it is not working properly - if I paste it, it does not get rendered. If I look at the copy in the clipboard I get an error. Any ideas what this could be?

AttributeError at /en/admin/cms/page/edit-plugin/319/
'NoneType' object has no attribute 'get_plugin_instance'
Request Method: GET
Request URL:    http://localhost:8000/en/admin/cms/page/edit-plugin/319/
Django Version: 1.6.11
Exception Type: AttributeError
Exception Value:    
'NoneType' object has no attribute 'get_plugin_instance'
Exception Location: /Users/zanderle/.virtualenvs/datafy-cms/src/djangocms-cascade-master/cmsplugin_cascade/bootstrap3/container.py in get_form, line 177

and

Environment:


Request Method: GET
Request URL: http://localhost:8000/en/admin/cms/page/edit-plugin/319/

Django Version: 1.6.11
Python Version: 2.7.8
Installed Applications:
('djangocms_admin_style',
 'djangocms_text_ckeditor',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'django_markwhat',
 'markdown',
 'cmsplugin_markdown',
 'cmsplugin_cascade',
 'cms',
 'pipeline',
 'menus',
 'sekizai',
 'mptt',
 'djangocms_style',
 'djangocms_column',
 'djangocms_file',
 'djangocms_flash',
 'djangocms_googlemap',
 'djangocms_inherit',
 'djangocms_link',
 'djangocms_picture',
 'djangocms_teaser',
 'djangocms_video',
 'south',
 'filer',
 'easy_thumbnails',
 'meta',
 'meta_mixin',
 'djangocms_page_meta',
 'datafyweb',
 'cmsplugin_clients',
 'cmsplugin_pricing',
 'cmsplugin_fullwidth')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware')


Traceback:
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  99.                     response = view_func(request, *args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  52.         response = view_func(request, *args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  198.             return view(request, *args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/cms/admin/pageadmin.py" in edit_plugin
  1497.             return super(PageAdmin, self).edit_plugin(*args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/views/decorators/clickjacking.py" in wrapped_view
  41.         resp = view_func(*args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/cms/admin/placeholderadmin.py" in edit_plugin
  405.             response = plugin_admin.change_view(request, str(plugin_id))
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  29.             return bound_func(*args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  99.                     response = view_func(request, *args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  25.                 return func(self, *args2, **kwargs2)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/db/transaction.py" in inner
  371.                 return func(*args, **kwargs)
File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/contrib/admin/options.py" in change_view
  1239.         ModelForm = self.get_form(request, obj)
File "/Users/zanderle/.virtualenvs/datafy-cms/src/djangocms-cascade-master/cmsplugin_cascade/bootstrap3/container.py" in get_form
  177.         parent_obj, parent_plugin = self.parent.get_plugin_instance()

Exception Type: AttributeError at /en/admin/cms/page/edit-plugin/319/
Exception Value: 'NoneType' object has no attribute 'get_plugin_instance'

0.4.0 Cascade plugin fails to show in drop-down after fresh install

Versions:
django 1.7
django-cms 3.0.6
djangocms-cascade 0.4.0 (pip install -e git+https://github.com/jrief/[email protected]#egg=djangocms-cascade)
MySQL 5.5

I followed the instructions at http://djangocms-cascade.readthedocs.org/en/latest/installation.html to create a fresh installation.

Django-cms runs fine and without error, but I don't get the djangocms-cascade appearing in the dropdown of the edit page.

My settings.py is:

"""
Django settings for wpf project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'zj1g_6m34i$$$g9f9%*om!08b4v30vg#nkkn-32n@@x%)_%8r='

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    'djangocms_text_ckeditor',
    'cmsplugin_cascade',
    'bootstrap3',
    'cms',  # django CMS itself
    'mptt',  # utilities for implementing a modified pre-order traversal tree
    'menus',  # helper for model independent hierarchical website navigation

    'sekizai',  # for javascript and css management
    'djangocms_admin_style',  # for the admin skin. You **must** add 'djangocms_admin_style' in the list **before** 'django.contrib.admin'.
    'reversion'

)
MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.middleware.common.CommonMiddleware',
    'cms.middleware.user.CurrentUserMiddleware',
    'cms.middleware.page.CurrentPageMiddleware',
    'cms.middleware.toolbar.ToolbarMiddleware',
    'cms.middleware.language.LanguageCookieMiddleware',
)

ROOT_URLCONF = 'wpf.urls'

WSGI_APPLICATION = 'wpf.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {

    'default': {

        'ENGINE': 'django.db.backends.mysql', 
        'NAME': 'wpf',
        'USER': 'wpf',
        'PASSWORD': '***',
        'HOST': '127.0.0.1',   
        'PORT': '3306',

    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'

STATIC_ROOT = os.path.join(BASE_DIR, "wpf/static")

MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_URL = "/media/"

TEMPLATE_DIRS = (
    # The docs say it should be absolute path: BASE_DIR is precisely one.
    # Life is wonderful!
    os.path.join(BASE_DIR, "wpf/templates"),
)

CMS_TEMPLATES = (
    ('template_1.html', 'Template One'),
    ('template_2.html', 'Template Two'),
)

LANGUAGES = [
    ('en', 'English'),
    ('en-us', 'English')
]

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.i18n',
    'django.core.context_processors.request',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'sekizai.context_processors.sekizai',
    'cms.context_processors.cms_settings',
)

SITE_ID = 1

MIGRATION_MODULES = {
    'cms': 'cms.migrations_django',
    'menus': 'menus.migrations_django',
}

CMS_CASCADE_PLUGINS = ('bootstrap3',)

CMS_PLACEHOLDER_CONF = {
    'Page Content': {
        'plugins': ['BootstrapContainerPlugin'],
    },
}

CMS_CASCADE_LEAF_PLUGINS = ('TextPlugin', 'FilerImagePlugin', 'OtherLeafPlugin',)

This issue has also been described at stackoverflow: http://stackoverflow.com/questions/26290309/djangocms-cascade-not-in-plugin-dropdown

Any suggestions most welcome.

Usage with custom cascade plugins

Hi,

can i use models.CascadeElement only with plugins that are not a part of djangocms-cascade?

The documentation says that I have to set CMS_CASCADE_PLUGINS and in cms_plugins.py you prepend cmsplugin_cascade to every plugin.

Best wishes,
Sebastian

0.4.0 - add support for container-fluid

Needed to add container-fluid support and was amazed/delighted that it took so few lines of code. Happy to do a pull request for this if you want.

$ git diff remotes/origin/derive-from-CascadeModelBase 
diff --git a/cmsplugin_cascade/bootstrap3/container.py b/cmsplugin_cascade/bootstrap3/container.py
index 5035c5a..f749b0b 100644
--- a/cmsplugin_cascade/bootstrap3/container.py
+++ b/cmsplugin_cascade/bootstrap3/container.py
@@ -67,7 +67,7 @@ class BootstrapContainerPlugin(BootstrapPluginBase):
         if container_max_widths:
             values = container_max_widths.values()
             return _("ranging from {0} through {1} pixels").format(min(values), max(values))
-        return six.u('')
+        return ''

     def save_model(self, request, obj, form, change):
         widest = CASCADE_BREAKPOINTS_LIST.index(obj.glossary['widest'])
@@ -92,6 +92,14 @@ class BootstrapContainerPlugin(BootstrapPluginBase):
 plugin_pool.register_plugin(BootstrapContainerPlugin)


+class BootstrapContainerFluidPlugin(BootstrapPluginBase):
+    name = _("Container (Fluid)")
+    default_css_class = 'container-fluid'
+    require_parent = False
+
+plugin_pool.register_plugin(BootstrapContainerFluidPlugin)
+
+
 class BootstrapRowForm(ManageChildrenFormMixin, ModelForm):
     """
     Form class to add non-materialized field to count the number of children.
@@ -105,7 +113,7 @@ class BootstrapRowForm(ManageChildrenFormMixin, ModelForm):
 class BootstrapRowPlugin(BootstrapPluginBase):
     name = _("Row")
     default_css_class = 'row'
-    parent_classes = ['BootstrapContainerPlugin', 'BootstrapColumnPlugin']
+    parent_classes = ['BootstrapContainerPlugin', 'BootstrapContainerFluidPlugin', 'BootstrapColumnPlugin']
     form = BootstrapRowForm
     fields = ('num_children', 'glossary',)
     glossary_fields = (

0.4.2 Cascade plugin error 'module' object has no attribute 'replace'. (Python 3.x)

Hi,
I'm testing the pluging 0.4.0 Cascade and I have got the bellow error with python version 3.x:

0.4.0 Cascade plugin error 'module' object has no attribute 'replace' at cmsplugin_cascade\bootstrap3\container.py
At line 276:
width = string.replace(obj.glossary.get('{0}-column-width'.format(bp), ''), 'col-{0}-'.format(bp), '')
string is deprecated in python 3.x
I did a quick fix with str function:
width = str.replace(obj.glossary.get('{0}-column-width'.format(bp), ''), 'col-{0}-'.format(bp), '')
and it worked.

str function is python 2.7 and 3.x compatible.

So, can you apply and recheck my suggestion, please?

Deprecation warning

I see a deprecation warning:

DeprecationWarning: please rename the table "cmsplugin_cascadeelement" to "cmsplugin_cascade_cascadeelement" in cmsplugin_cascade
The compatibility code will be removed in 3.1
table_name, old_db_name, model._meta.app_label), DeprecationWarning)

Dependencies:

Django==1.6.2
South==0.8.4
django-cms==3.0
djangocms-cascade==0.3.0

Also, dumpdata command fails with the following error: CommandError: Unable to serialize database: relation "cmsplugin_cascade_cascadeelement" does not exist

AppRegistryNotReady: Models aren't loaded yet.

This was already mentioned in issue #52, but since it's a different issue, I decide to open a new thread.

I keep getting the above mentioned exception when trying to migrate the db or run a dev server (runserver) after installing the cascade plugin. I upgraded Django from 1.7.1 to 1.7.4, but to no avail. I took the settings directly from the bs3demo and integrated them into my own settings. I'm also using djangocms 3.0.9.

On a sidenote: I understand you probably have a lot to do, but you should know that the current docs have some holes in them (e.g. dependency for django-bootstrap3 vs cmsplugin_cascade.bootstrap3, CMS_CASCADE_PLUGINS, adding the plugin to MIGRATION_MODULES).

Please find my freeze below. If you need more info, for example a stacktrace or settings.py, please let me know. I didn't want to bloat the OP too much.

(datamantics_com)[jvlek@orochimaru datamantics.com]$ pip freeze
You are using pip version 6.0.6, however version 6.0.7 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
bcrypt==1.1.0
cffi==0.8.6
cmsplugin-filer==0.10.1
dj-database-url==0.3.0
dj-static==0.0.6
Django==1.7.4
django-appconf==0.6
django-classy-tags==0.5.2
django-cms==3.0.9
django-filer==0.9.9
-e git://github.com/jeroenvlek/django-form-designer.git@71adc056e028efcb6e0a1303f798ea86ba9a715b#egg=django_form_designer-master
django-mptt==0.6.1
django-picklefield==0.3.1
django-polymorphic==0.6.1
django-reversion==1.8.5
django-sekizai==0.8.1
django-sslify==0.2.5
django-toolbelt==0.0.1
djangocms-admin-style==0.2.5
djangocms-cascade==0.4.2
djangocms-link==1.5
djangocms-picture==0.1
-e git://github.com/jeroenvlek/djangocms-revealjs.git@a81084228404a2b1f6ab0532fcbce5b74a6c2348#egg=djangocms_revealjs-master
djangocms-text-ckeditor==2.4.3
djangorestframework==3.0.2
easy-thumbnails==2.2
gunicorn==19.1.1
html5lib==0.999
jsonfield==1.0.0
Pillow==2.7.0
psycopg2==2.5.4
pycparser==2.10
pytz==2014.10
requests==2.5.1
sendgrid==1.2.0
shortuuid==0.4.2
six==1.8.0
smtpapi==0.1.2
South==1.0.2
static3==0.5.1
Unidecode==0.4.17
unittest2py3k==0.5.1

Bs3demo with Cascade 0.4.x the Bootstrap3 Navbar no works!

Hi,
I have followed all instructions from the documentation ("For the impatient") to do a quick install from the scratch and it seems work well because I can create pages and subpages with the menu option enable but a strange issue happen.

The Bootstrap3 Navbar no works and the page title no change.
I have investigate a little and seems that in the generated template is missing the bootstrap javascript.
I guess that the {% render_block "js" %} in the base template shoulb be added all javascript, but it's no happen.
I have to added it manually in the template and then the Bootstrap3 Navbar works.
I have to added manually this tag <title>{% block title %}Page Title{% endblock %}</title> in the same template and then the page title works again.
My question,
Is this the normal procedure or this is an issue in this cascade version?
Or I have to take the default templates from the djangocms and added the missing tags that you said in the documentation?

Regards,
Jeymy

add support for adding plugins through the django-cms API

I was trying to a migration of a site and I wanted to populate the pages programatically but the API seems not to be working with the plugin.

I made a simple test following the example on the docs and the djangocms-installer

# p is a dic with the title, slug, and other standard page creation values
page = create_page(**p)
placeholder = page.placeholders.get(slot='content')
add_plugin(placeholder, 'BootstrapContainerPlugin', 'en')
publish_page(page, User.objects.all()[0], p['language'])

The page is created as expected but there is no container inside the content structure. Also after trying to add the container manually to this same page, something seems to be broken, so that after clicking on accept changes a dialog with a python error trace is displayed for a moment.

Am I using the right class here 'BootstrapContainerPlugin'?

0.4.0 - BootstrapContainerPluginModel has not been registered with django-reversion

I don't quite know what to make of this...

I have installed

django-cms==3.0.7
Django==1.6.8
djangocms-cascade==0.4.0

In my settings.py:

CMSPLUGIN_CASCADE_PLUGINS = ('cmsplugin_cascade.bootstrap3',)

Upon publishing a page containing cascade plugins, I get this error message:

<class 'cmsplugin_cascade.models.BootstrapContainerPluginModel'> has not been registered with django-reversion

What am I missing?

Docs example on "hard coded containers" leads to "KeyError"

Documentation has a little tutorial to allow inserting a BootstrapRowPlugin directly into placeholders, if you already provide container in template (http://djangocms-cascade.readthedocs.org/en/latest/bootstrap3/grid.html#adding-plugins-into-a-hard-coded-grid)

Trying to use a BootstrapImagePlugin in such situation (placing it inside BootstrapRowPlugin > BootstrapColumnPlugin ) results in a KeyError being raised while accessing glossary['media_queries'] (https://github.com/jrief/djangocms-cascade/blob/0.4.3/cmsplugin_cascade/bootstrap3/utils.py#L71).

This is solved using bs3settings.py'-like CMS_PLACEHOLDER_CONF, which defines COLUMN_GLOSSARY, which in turn defines 'media_queries' and uses it for configuring the placeholder.

If I didn't miss anything, my proposal is to update the documentation to use a more complete glossary (maybe just copy-paste COLUMN_GLOSSARY). Let me know if you would like a PR for this.

Maybe there are other plugins that need these defaults when used outside a container, but BootstrapImagePlugin is the only one I found so far.

Cheers

Container reports: There are no further settings for this plugin

I have installed djangocms-cascade version 0.3.2 under a virtualenv. I am running djangocms version 3.0.6 with django 1.7.

I can add a container to my page. But when I try to edit the container, I get the error "there are no further settings for this plugin".

The output from runserver is as follows:

'''
[09/Oct/2014 23:11:06] "GET / HTTP/1.1" 200 19331
[09/Oct/2014 23:11:07] "GET /static/cms/js/libs/jquery.min.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/jquery.ui.nestedsortable.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/css/cms.base.css HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/jquery.ui.custom.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/libs/class.min.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/cms.base.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/cms.modal.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/cms.sideframe.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/cms.clipboard.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/cms.plugins.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/cms.structureboard.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/js/modules/cms.toolbar.js HTTP/1.1" 304 0
[09/Oct/2014 23:11:07] "GET /static/cms/img/toolbar/sprite_toolbar.png HTTP/1.1" 304 0
[09/Oct/2014 23:11:09] "GET /static/cms/img/loader.gif HTTP/1.1" 304 0
[09/Oct/2014 23:11:09] "GET /admin/cms/page/edit-plugin/1/ HTTP/1.1" 200 2398
[09/Oct/2014 23:11:09] "GET /static/css/cms.bootstrap.css HTTP/1.1" 200 594
[09/Oct/2014 23:11:10] "GET /static/cms/css/cms.toolbar.modal.css HTTP/1.1" 304 0
'''

One path that I chased down was that I was getting a 404 for /static/cms/css/cms.toolbar.modal.css. This did not seem to be part of the install. I manually downloaded from github and copied into my static/css directory.

Any suggestions much appreciated.

Matthew

TemplateSyntaxError at /admin/cms/page/add/ Invalid block tag: 'main_menu', expected 'endblock'

I followed the "for the impatient" tutorial for both the latest and stable releases. I came across this issue when trying to add the first page.

Do you have any hint on what to try ?

You can find below the full stacktrace :

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/admin/cms/page/add/?language=en-us

Django Version: 1.6.8
Python Version: 2.7.8
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'djangocms_admin_style',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.staticfiles',
'django.contrib.sitemaps',
'djangocms_text_ckeditor',
'django_select2',
'cmsplugin_cascade',
'cmsplugin_cascade.extra_fields',
'cmsplugin_cascade.sharable',
'cms',
'menus',
'mptt',
'filer',
'easy_thumbnails',
'sekizai',
'bs3demo',
'south')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.gzip.GZipMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware')

Traceback:
File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/src/django-cms/cms/admin/pageadmin.py" in add_view
  6.     return super(PageAdmin, self).add_view(request, form_url, extra_context=extra_context)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  7.         return bound_func(_args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  8.                 response = view_func(request, _args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  9.             return func(self, _args2, *_kwargs2)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/db/transaction.py" in inner
  10.             return func(_args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view
  11.             self.save_model(request, new_object, form, False)
    
    File "/home/hadrien/Projets/Cascade/impatient2/src/django-cms/cms/admin/pageadmin.py" in save_model
  12.     obj.save()
    
    File "/home/hadrien/Projets/Cascade/impatient2/src/django-cms/cms/models/pagemodel.py" in save
  13.             super(Page, self).save(**kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/mptt/models.py" in save
  14.         super(MPTTModel, self).save(_args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/db/models/base.py" in save
  15.                    force_update=force_update, update_fields=update_fields)
    
    File "/home/hadrien/Projets/Cascade/impatient2/src/django-cms/cms/models/pagemodel.py" in save_base
  16.     ret = super(Page, self).save_base(_args, *_kwargs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/db/models/base.py" in save_base
  17.                                update_fields=update_fields, raw=raw, using=using)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/dispatch/dispatcher.py" in send
  18.         response = receiver(signal=self, sender=sender, **named)
    
    File "/home/hadrien/Projets/Cascade/impatient2/src/django-cms/cms/signals/page.py" in post_save_page
  19.     instance.rescan_placeholders()
    
    File "/home/hadrien/Projets/Cascade/impatient2/src/django-cms/cms/models/pagemodel.py" in rescan_placeholders
  20.     placeholders = get_placeholders(self.get_template())
    
    File "/home/hadrien/Projets/Cascade/impatient2/src/django-cms/cms/utils/plugins.py" in get_placeholders
  21. compiled_template = get_template(template)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/loader.py" in get_template
  22. template, origin = find_template(template_name)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/loader.py" in find_template
  23.         source, display_name = loader(name, dirs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/loader.py" in call
  24.     return self.load_template(template_name, template_dirs)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/loader.py" in load_template
  25.         template = get_template_from_string(source, origin, template_name)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/loader.py" in get_template_from_string
  26. return Template(source, origin, name)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/base.py" in init
  27.     self.nodelist = compile_string(template_string, origin)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/base.py" in compile_string
  28. return parser.parse()
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/base.py" in parse
  29.                 compiled_result = compile_func(self, token)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/loader_tags.py" in do_extends
  30. nodelist = parser.parse()
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/base.py" in parse
  31.                 compiled_result = compile_func(self, token)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/loader_tags.py" in do_block
  32. nodelist = parser.parse(('endblock',))
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/base.py" in parse
  33.                 self.invalid_block_tag(token, command, parse_until)
    
    File "/home/hadrien/Projets/Cascade/impatient2/lib/python2.7/site-packages/django/template/base.py" in invalid_block_tag
  34.             (command, get_text_list(["'%s'" % p for p in parse_until])))
    

Exception Type: TemplateSyntaxError at /admin/cms/page/add/
Exception Value: Invalid block tag: 'main_menu', expected 'endblock'

KeyError 'FilerImagePlugin'

Once I make a row I get this error when i switch to draft mode. Did I set something up wrong. Was a dependency of FilerImagePlugin supposed to be installed?

'FilerImagePlugin'
Request Method: GET
Request URL:    http://localhost:8000/en/about-me/?edit
Django Version: 1.6.5
Exception Type: KeyError
Exception Value:    
'FilerImagePlugin'
Exception Location: /home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/local/lib/python2.7/site-packages/cms/plugin_pool.py in get_plugin, line 242
Python Executable:  /home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/bin/python
Python Version: 2.7.6
Python Path:    
['/home/jeremy/Dropbox/Programming/webdevelopment/djangocms',
 '/home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/lib/python2.7',
 '/home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/lib/python2.7/plat-x86_64-linux-gnu',
 '/home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/lib/python2.7/lib-tk',
 '/home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/lib/python2.7/lib-old',
 '/home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/home/jeremy/Dropbox/Programming/webdevelopment/djangocms/env/local/lib/python2.7/site-packages']
Server time:    Wed, 2 Jul 2014 20:18:01 -0500

Feature: Bootstrap img-responsive

I'm missing a feature to make images (e.g. from FilerImagePlugin) responsive. So by simply adding the "img-responsive" class. Would it be possible to do this?

Copying row with columns loses width

Steps to reproduce, using the reference installation as described in: http://djangocms-cascade.readthedocs.org/en/latest/impatient.html

1 Add a container to the placeholder
2 Add a row with some number of columns
3 Copy the row (At this point the width is already lost from the glossary)
4 Paste the row into the container
Result: The row has columns with unknown width

It looks like the problem is that since the row has no parent, the glossary will not contain the breakpoints from the container, and BootstrapColumnPlugin.sanitize_model will remove the width keys from the glossary.

A workaround is to add a 'clipboard' placeholder to CMS_PLACEHOLDER_CONF, with a glossary with breakpoints and container_max_widths.

'clipboard': {
    'glossary': {
        'breakpoints': ['xs', 'sm', 'md', 'lg'],
        'container_max_widths': {'xs': 750, 'sm': 750, 'md': 970, 'lg': 1170},
    }
}

Maybe there should be a default glossary to fallback to or maybe the breakpoints and container_max_widths should be copied to the column glossary when it's copied, but then it needs to be removed again when the row is pasted into another container with possibly different settings.

Bootstrap Rows responsive dimenstion cannot be updated

I have noticed that once you create a row containing some columns in a container, the responsive dimension (xs, sm, md, ...) cannot be changed anymore. If i update the container and change the dimension from xs to md, the colums will still be renderedas xs columns.

It is my assumption that the Container plugin does not update its dimension information to its child plugins when it is being edited. This assumption seems to be confirmed when looking at the code: https://github.com/jrief/djangocms-cascade/blob/master/cmsplugin_cascade/bootstrap3/container.py#L26

Kevin

Error during template rendering fieldset.html

Receive an error when selecting "Edit" in the frontend interface using the carousel module. The error is summarized below. Any help is much appreciated.

Notes: I used the install tutorial for django-cms 3.0.0.beta3 at http://docs.django-cms.org/en/develop/. Then followed the install instructions for djangocms-bootstrap.

I have a working carousel but cannot edit the carousel. Editing the sliders work.

[ complete error code at http://dpaste.com/hold/1532741/ ]

Error Message....

Error during template rendering

In template /djangobootstrap/local/lib/python2.7/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
expected string or buffer

...
11 : {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
12 : {% if field.is_checkbox %}
13 : {{ field.field }}{{ field.label_tag }}
14 : {% else %}
15 : {{ field.label_tag }}
16 : {% if field.is_readonly %}
17 : {{ field.contents|linebreaksbr }}
18 : {% else %}
19 : {{ field.field }}
20 : {% endif %}
21 : {% endif %}
22 : {% if field.field.help_text %}
23 : {{ field.field.help_text|safe }}
24 : {% endif %}

....

Exception Value: super(type, obj): obj must be an instance or subtype of type

v: 0.4.1
When saving a new collapsable panel.
cmsplugin_cascade/bootstrap3/collapse.py in get_identifier, line 64

Line 64: identifier = super(PanelGroupPlugin, cls).get_identifier(obj)

@classmethod
def get_identifier(cls, obj):
    identifier = super(PanelGroupPlugin, cls).get_identifier(obj)
    content = obj.glossary.get('panel_title', '')
    if content:
        content = unicode(Truncator(content).words(3, truncate=' ...'))
    return format_html('{0}{1}', identifier, content)

Feature: Should let users define arbitrary style classes for Simple Wrapper plugin

Right now it seems to me that Simple Wrappe can only have divs with thumbnail and jumbotron classes. I feel its functionalities pretty restricted by such hardcoding. I suggest that users should be able to either predefine some classes in settings.py so that they can choose from a list of styles (similar to this plugin: https://github.com/divio/djangocms-style) or they can enter wildcard class names when using this plugin.

Cant set Column Width's in one try

Okay so I figured out how to change the column width on the cms. However I noticed a small little bug (at least I think it is).
For example if you have a Default Width (xs-col) and it is set at 4 already, and you want to change it to 12 you can. But if you want to change the width for the "Width for Devcies > 768 px" to 6 it will not be possible, it will only let you go to 4.
However if you save the form. Then open it up again it will now let you go to 6.

Basically the default width limits the choices of the other dropdowns. However if you change that defualt width it will not update the available options in the other dropdowns. You will have to save the form then reopen again.
cms_cascade_error

Issue with FilerImagePlugin

Hi, I'm posting it here so that other people can profit from replies.

I installed djangocms-cascade on a brand new djangoCMS 3.0 installation, but as soon as I created a row within a page I got an error related to FilerImagePlugin:

site-packages/cmsplugin_cascade/templates/cms/plugins/generic.html, error at line 5
Exception Value: 'FilerImagePlugin'

I am a noob with python, so I tried to install packages before writing any line of code.
I managed to fix it by installing cmsplugin-filer and django-filer.

I'd just like to know if what I've done makes sense and if it's the right way to handle this "issue".

When installing development version, Django can't find cascade templates

I installed it directly from commit using -e git+https://github.com/jrief/djangocms-cascade.git@dd3ee3528d3401522f5f084374a9b265be5bb31f#egg=djangocms_cascade-master . This works but when I runserver, it fails because Django cannot find cascade's templates.

If I override the templates locally, things start working again. Any ideas why Django cannot find templates in djangocms-cascade?

This is the error I get:

Unhandled exception in thread started by <function wrapper at 0x1062aade8>
Traceback (most recent call last):
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/autoreload.py", line 93, in wrapper
    fn(*args, **kwargs)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 102, in inner_run
    self.validate(display_num_errors=True)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/core/management/base.py", line 310, in validate
    num_errors = get_validation_errors(s, app)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/core/management/validation.py", line 34, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors
    self._populate()
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _populate
    self.load_app(app_name, True)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
    models = import_module('%s.models' % app_name)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/zanderle/.virtualenvs/datafy-cms/src/djangocms-cascade-master/cmsplugin_cascade/models.py", line 23, in <module>
    class PluginExtraFields(models.Model):
  File "/Users/zanderle/.virtualenvs/datafy-cms/src/djangocms-cascade-master/cmsplugin_cascade/models.py", line 29, in PluginExtraFields
    CUSTOMIZABLE_PLUGINS = _plugins_for_site()
  File "/Users/zanderle/.virtualenvs/datafy-cms/src/djangocms-cascade-master/cmsplugin_cascade/models.py", line 19, in _plugins_for_site
    cascade_plugins = set([p for p in plugin_pool.get_all_plugins() if issubclass(p, ExtraFieldsMixin)])
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/cms/plugin_pool.py", line 217, in get_all_plugins
    self.discover_plugins()
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/cms/plugin_pool.py", line 36, in discover_plugins
    load('cms_plugins')
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/cms/utils/django_load.py", line 56, in load
    get_module(app, modname, verbose, failfast)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/cms/utils/django_load.py", line 40, in get_module
    module = import_module(module_name)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/zanderle/.virtualenvs/datafy-cms/src/djangocms-cascade-master/cmsplugin_cascade/cms_plugins.py", line 14, in <module>
    import_module('{0}.{1}'.format(module, p))
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/Users/zanderle/.virtualenvs/datafy-cms/src/djangocms-cascade-master/cmsplugin_cascade/bootstrap3/image.py", line 196, in <module>
    plugin_pool.register_plugin(BootstrapImagePlugin)
  File "/Users/zanderle/.virtualenvs/datafy-cms/lib/python2.7/site-packages/cms/plugin_pool.py", line 87, in register_plugin
    % (plugin, template)
django.core.exceptions.ImproperlyConfigured: CMS Plugins must define a render template (<class 'cmsplugin_cascade.bootstrap3.image.BootstrapImagePlugin'>) that exists: cascade/bootstrap3/linked-image.html

0.4.0 Cascade plugin is not working well with the picture option. The picture data is not saved.

Hi,
I'm testing cascade 0.4.0 and everything seems ok. I can put the container, the row, 3 columns, etc... Then in the first column I have put a text, everything was ok. In the second column I have put a picture, I have populate all fields regrading the picture plugin, even I have put an image, and I have clicked in the save button.
The window was closed and the leaf picture plugin was added as was added the text plugin before. But in the picture plugin It said that is empty, and I click in the picture for edit, and all properties of the picture plugin have been lost.
What is wrong with this? What I'm doing wrong with this? If is there something wrong, why the plugin is not showing any error message when I have clicked the save button?
I'm using django 1.7.1 with python 3.4 and the djangocms developer version.
My installed packages version are:
capture

Plugin carousel as specified in cmsplugin_cascade.bootstrap3.settings.CMSPLUGIN_CASCADE_PLUGINS could not be loaded

Thank you for this terrific api.

I'm having trouble activating some of the plugins, particularly the carousel, image, and picture. In my settings.py, if I activate all plugins with:

CMSPLUGIN_CASCADE_PLUGINS = ('cmsplugin_cascade.bootstrap3',)

it throws the error in the title of this post. When I specify specific plugins such as buttons, collapsable, and container, it works, but it doesn't work for carousel, picture, and images.

PlaceholderField shall use glossary

Currently Django-CMS PlaceholderField has one additional field, named default_width. With this cascade plugin, it would make much more sense to replace this against a more generic JSONField, which is able to hold any arbitrary data, including default_width.

Can't drag&drop bootstrap3 plugins

I have running the latest develop version of django-cms and current master of djangocms-cascade.
Unfortunately it is not possible to move/drag'n'drop the bootstrap3 plugins. The "drop-area" is always red and its not possible to drop the plugin. This at least occurs for rows, horizontal lines and columns. Possibly also for others.
This also occurs, when I try to copy a plugin and "paste" it (so d&d from the clipboard).

I do not have defined any CMS_PLACEHOLDER_CONF in my settings.
Here's my current pip freeze: https://gist.github.com/asmaps/9388717

0.4.0 Can't add ExtraFieldsMixin to BootstrapColumnPlugin

Hi, I've added the ExtraFieldsMixin to all the container classes (to allow custom styles to be added), and it's working fine for the container and row. However the extra fields don't show up on the columns.

Looks like it's because the glossary fields are emptied at the top of the get_form function, wiping out the extra fields added by the mixing. I've got it working for my local case with the nasty hack of

extra_fields = []
field_list = ['xs-column-width','xs-responsive-utils','sm-column-width','sm-column-offset','sm-responsive-utils','md-column-width','md-column-offset','md-responsive-utils','lg-column-width','lg-column-offset','lg-responsive-utils']
for field in self.glossary_fields:
    if field.name not in field_list:
        extra_fields.append(field)
self.glossary_fields = extra_fields

But I'm sure there's a nicer way.

0.4.0 error 404 when accessing bootstrap css in bs3demo

[04/Dec/2014 12:40:36] "GET /static/bootstrap/dist/css/bootstrap.css HTTP/1.1" 404 1700

What's the correct way to install bootstrap-css assumed by the bs3demo? I installed bootstrap-css using bower, then did a ./manage.py collect static but the resulting paths don't match. Just manually moved things around.

Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/bower.json'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/README.md'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/css/bootstrap-theme.css'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/css/bootstrap-theme.css.map'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/css/bootstrap-theme.min.css'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/css/bootstrap.css'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/css/bootstrap.css.map'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/css/bootstrap.min.css'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/fonts/glyphicons-halflings-regular.eot'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/fonts/glyphicons-halflings-regular.svg'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/fonts/glyphicons-halflings-regular.ttf'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/fonts/glyphicons-halflings-regular.woff'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/js/bootstrap.js'
Copying '/Users/bschott/Source/djangocms-cascade/bower_components/bootstrap-css/js/bootstrap.min.js'

0.4.0 uncaught multiple objects returned exception from PluginExtraFields

screen shot 2014-12-04 at 3 26 00 pm

Environment:


Request Method: GET
Request URL: http://localhost:8000/

Django Version: 1.7.1
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'djangocms_admin_style',
 'django.contrib.messages',
 'django.contrib.admin',
 'django.contrib.staticfiles',
 'django.contrib.sitemaps',
 'djangocms_text_ckeditor',
 'django_select2',
 'cmsplugin_cascade',
 'cmsplugin_cascade.sharable',
 'cms',
 'menus',
 'mptt',
 'filer',
 'easy_thumbnails',
 'sekizai',
 'bs3demo')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware')


Traceback:
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  137.                 response = response.render()
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/response.py" in render
  103.             self.content = self.rendered_content
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  80.         content = template.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  148.             return self._render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  126.         return compiled_parent._render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py" in render_tag
  76.         rendered_contents = nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
  682.         rendered_contents = nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
  319.             content = get_placeholder_content(context, request, page, name, inherit, nodelist)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in get_placeholder_content
  238.         content = render_placeholder(placeholder, context, name)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_placeholder
  158.     content.extend(render_plugins(plugins, context, placeholder, processors))
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_plugins
  85.         out.append(plugin.render_plugin(context, placeholder, processors=processors))
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/models/pluginmodel.py" in render_plugin
  198.             return render_plugin(context, instance, placeholder, template, processors, context.current_app)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_plugin
  56.         content = render_to_string(template, context_instance=context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  174.         return t.render(context_instance)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  148.             return self._render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  527.             return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  208.                         nodelist.append(node.render(context))
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/helpers.py" in render_tag
  78.         data = self.get_context(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in get_context
  375.                 processors=processors
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/models/pluginmodel.py" in render_plugin
  198.             return render_plugin(context, instance, placeholder, template, processors, context.current_app)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_plugin
  56.         content = render_to_string(template, context_instance=context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  174.         return t.render(context_instance)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  148.             return self._render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  527.             return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  208.                         nodelist.append(node.render(context))
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/helpers.py" in render_tag
  78.         data = self.get_context(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in get_context
  375.                 processors=processors
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/models/pluginmodel.py" in render_plugin
  198.             return render_plugin(context, instance, placeholder, template, processors, context.current_app)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_plugin
  56.         content = render_to_string(template, context_instance=context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  174.         return t.render(context_instance)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  148.             return self._render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  527.             return self.nodelist.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/base.py" in render_node
  858.         return node.render(context)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  208.                         nodelist.append(node.render(context))
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/core.py" in render
  106.         return self.render_tag(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/classytags/helpers.py" in render_tag
  78.         data = self.get_context(context, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in get_context
  375.                 processors=processors
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/models/pluginmodel.py" in render_plugin
  179.         instance, plugin = self.get_plugin_instance()
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/models/pluginmodel.py" in get_plugin_instance
  163.         plugin = self.get_plugin_class_instance(admin)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/cms/models/pluginmodel.py" in get_plugin_class_instance
  149.         return plugin_class(plugin_class.model, admin)
File "/Users/bschott/Source/djangocms-cascade/cmsplugin_cascade/mixins.py" in __init__
  33.             extra_fields = PluginExtraFields.objects.get(plugin_type=self.__class__.__name__, site=site)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
  92.                 return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/Users/bschott/.virtualenvs/djangocms-cascade/lib/python2.7/site-packages/django/db/models/query.py" in get
  361.                 num if num <= MAX_GET_RESULTS else 'more than %s' % MAX_GET_RESULTS

Exception Type: MultipleObjectsReturned at /
Exception Value: get() returned more than one PluginExtraFields -- it returned 2!

Id and classes to row and columns

Could be useful to have the possibility to specify custom id and class for rows and columns, so will be easy to customize with css

0.4.0 AttributeError in LinkedPictureForm

I'm not sure why, perhaps because of django 1.7, it seems like a None instance can be passed to forms. So LinkedPictureForm fails with an AttributeError on line 100. In the snippet below I've added AttributeError to the except block, but I'm not 100% sure that's the correct solution.

def __init__(self, *args, **kwargs):                                        
         try:                                                                    
             initial = dict(kwargs['instance'].glossary)              # <- This line
         except (KeyError, AttributeError):                                      
             initial = {}                                                        
         initial.setdefault('link', {'type': 'none'})                            
         initial.update(kwargs.pop('initial', {}))                               
         super(LinkedPictureForm, self).__init__(initial=initial, *args, **kwargs)

Python 3 support

Hi, I was wondering, does djangocms-cascade work with Python 3 or are there any plans to support it in the future?

Version 0.4.0

I would like to release version 0.4.0 to PyPI.
There have been reported some issues with Django-CMS, which I was unable to reproduce.
Could you please checkout the latest release and check it in your environment.

Does anybody still use 960.gs or Bootstrap-2.3.2?

Jacob

Translations

I'd like to contribute german translations to the project, but I can't find any doc on how to translate things. Is there a transifex project for this? If not, would it be possible to create one?

Navigation menu code attached.

First, I am not that familiar with git and github so I am posting here so I do not screw up anyone's work.

This is not an issue but I wanted to share code to add navigation menu using twitter bootstrap styling and as shown is this example: http://getbootstrap.com/2.3.2/examples/carousel.html .


Andrew P.
Source3 Computing

Steps:

Add show_menu to projects base.html (or the template you want to render the menu)

<!-- continued from base.html -->
    <!--  Overrides the default template to use bootstrap styling to the nav menu -->
    <!--  menu starts a node 0, then iterates down through the child pages -->
    <!--  changes numbers after first parameter to increase number of pages/childs -->

    {% show_menu 0 10 10 10 "my_menu/menu-custom.html" %}   

    <!-- / override menu  -->

Create a new template in "/templates/my_menu/menu-custom.html" with the following code.

{% load menu_tags %}
    <!-- NAVBAR
    ================================================== -->
    <!-- Read about Bootstrap dropdowns at http://twbs.github.com/bootstrap/javascript.html#dropdowns -->
    <div class="navbar-wrapper">
      <!-- Wrap the .navbar in .container to center it within the absolutely positioned parent. -->
      <div class="container">

        <div class="navbar navbar-inverse">
          <div class="navbar-inner">
            <!-- Responsive Navbar Part 1: Button for triggering responsive navbar (not covered in tutorial). Include responsive CSS to utilize. -->
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="brand" href="#">Project name</a>
            <!-- Responsive Navbar Part 2: Place all navbar contents you want collapsed withing .navbar-collapse.collapse. -->
            <div class="nav-collapse collapse">
              <ul class="nav">

              <!-- *********  MODIFY THIS SECTION  *******-->

              {% for child in children %}

                <!-- no child pages  -->
                {% if child.is_leaf_node %}
                  <li><a href="{{ child.get_absolute_url }}">{{child.get_menu_title }}</a></li>
                {% endif %}
                <!-- /no child pages  -->

                <!-- has child pages  -->
                {% if not child.is_leaf_node or child.ancestor %}
                  <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{child.get_menu_title }}<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                      {% if child.get_descendants %}
                        {% for kid in child.get_descendants %}
                          <li><a href="{{ kid.get_absolute_url }}">{{kid.get_menu_title }}</a></li>
                        {% endfor %}  
                      {% endif %}
                    </ul>
                  </li>     
                {% endif %}
                <!-- /has child pages  -->

              {% endfor %} <!-- /end for child -->


              </ul>
            </div><!--/.nav-collapse -->
          </div><!-- /.navbar-inner -->
        </div><!-- /.navbar -->
      </div> <!-- /.container -->
    </div><!-- /.navbar-wrapper -->

In the head of base.html, have css code

  <head>
      <title>Bootstrap 2.3 Template</title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.min.css" />
      <link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap_custom.css" /> 
      <link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap-responsive.min.css" />
      {% render_block "css" %}
  </head>

Then right before the end of the body section of base.html

      <script src="{{ STATIC_URL }}js/bootstrap.min.js" type="text/javascript"></script>
      <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
      <script src="//netdna.bootstrapcdn.com/bootstrap/2.3.2/js/bootstrap.min.js"</script>

      <script>
        !function ($) {
          $(function(){
            $('.dropdown-toggle').dropdown();
          })
        }(window.jQuery)
      </script>
      {% render_block "js" %}
  </body>

0.4.0 - cmsplugin_cascade.sharable models not discovered

Sometimes I miss the most obvious things. Stared at migrations a long time before I realized that the sharable models weren't being loaded. I had to have the following in INSTALLED_APPS:

'cmsplugin_cascade',
'cmsplugin_cascade.sharable',

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.