Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
skos
Commits
7362e4418a79
Commit
fc840755
authored
Aug 03, 2021
by
Noé Gaumont
🐙
Browse files
fix: try to import cube relationwidget with new and old cube format
parent
4138933b4bd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_skos/views/widgets.py
View file @
7362e441
...
...
@@ -17,12 +17,22 @@
from
cubicweb
import
tags
from
cubicweb.predicates
import
is_instance
relationwidget_imported
=
False
try
:
from
cubes.relationwidget
import
views
as
rwdg
from
cubicweb_relationwidget
import
views
as
rwdg
relationwidget_imported
=
True
except
ImportError
:
pass
else
:
if
not
relationwidget_imported
:
# try to import old_style cube format if it failed with new_format
try
:
from
cubes.relationwidget
import
views
as
rwdg
# noqa
relationwidget_imported
=
True
except
ImportError
:
pass
if
relationwidget_imported
:
class
SearchForRelatedConceptsView
(
rwdg
.
SearchForRelatedEntitiesView
):
"""Specializes relation widget to link to concepts which are expected to be constrained by
an RQL expression on the edited relation definition.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment