Skip to content

Commit f865a48

Browse files
committed
Fix: Version 3 import
1 parent d65ed70 commit f865a48

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

README.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44

55
|pypi| |docs| |coverage| |python| |django| |djangocms| |djangocms4|
66

7-
**django CMS Frontend** is a plugin bundle which builds on and improves
7+
**django CMS Frontend** is a plugin bundle which originally built on and improved
88
the architecture of `djangocms-bootstrap4 <https://github.com/django-cms/djangocms-bootstrap4>`_.
9-
Its objective is to provide a set of popular frontend components independent of the
10-
currently used frontend framework such as Bootstrap, or its specific version.
9+
Its objective is to provide a toolset to quickly create re-usable frontend
10+
components and comes preloaded with a set of popular frontend components
11+
independent of the currently used frontend framework such as Bootstrap, or
12+
its specific version.
1113

1214
.. image:: preview.png
1315

1416
Key features
1517
============
1618

19+
- Easy to implement re-usable frontend custom components.
1720
- Support of `Bootstrap 5 <https://getbootstrap.com>`_, django CMS 3.8+
1821
and django CMS 4.
1922

djangocms_frontend/ui_plugin_base.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
from cms.admin.placeholderadmin import PlaceholderAdmin
21
from cms.plugin_base import CMSPluginBase
32

43
# Import the components from the current directory's models module
54
from django.utils.encoding import force_str
65

76
from djangocms_frontend.helpers import get_related
87

9-
if hasattr(PlaceholderAdmin, "edit_field"):
10-
# FrontendEditable functionality already implemented in core?
11-
class FrontendEditableAdminMixin:
12-
pass
13-
else:
14-
# If not use our own version of the plugin-enabled mixin
8+
try:
9+
from cms.admin.placeholderadmin import PlaceholderAdmin
10+
11+
if hasattr(PlaceholderAdmin, "edit_field"):
12+
# FrontendEditable functionality already implemented in core?
13+
class FrontendEditableAdminMixin:
14+
pass
15+
else:
16+
# If not use our own version of the plugin-enabled mixin
17+
raise ImportError
18+
except ImportError:
19+
# django CMS 3 did not implement this: use our own version of the plugin-enabled mixin
1520
from .helpers import FrontendEditableAdminMixin
1621

1722

0 commit comments

Comments
 (0)