Fix can add column with interface +
@@ -197,11 +197,31 @@ class BootstrapColumnPlugin(BootstrapPluginBase):
else:
return phrases[2]
+ if 'parent' in self._cms_initial_attributes:
+ try:
+ query = Q(plugin_type='BootstrapContainerPlugin')
+ container = self._cms_initial_attributes['parent'].get_ancestors().order_by('depth').filter(
+ query).last().get_bound_plugin()
+ except AttributeError:
+ try:
+ query = Q(plugin_type='BootstrapJumbotronPlugin')
+ container = self._cms_initial_attributes['parent'].get_ancestors().order_by('depth').filter(
+ query).last().get_bound_plugin()
+ except AttributeError:
+ raise grid.BootstrapException(
+ "Can not add BootstrapColumnPlugin without BootstrapContainerPlugin or BootstrapJumbotronPlugin")
+ else:
try:
query = Q(plugin_type='BootstrapContainerPlugin')
container = obj.get_ancestors().order_by('depth').filter(query).last().get_bound_plugin()
except AttributeError:
- raise grid.BootstrapException("Can not add BootstrapColumnPlugin without BootstrapContainerPlugin")
+ try:
+ query = Q(plugin_type='BootstrapJumbotronPlugin')
+ container = obj.get_ancestors().order_by('depth').filter(
+ query).last().get_bound_plugin()
+ except AttributeError:
+ raise grid.BootstrapException(
+ "Can not add BootstrapColumnPlugin without BootstrapContainerPlugin or BootstrapJumbotronPlugin")
breakpoints = container.glossary['breakpoints']
glossary_fields = []
