Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
link
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
link
Commits
a8feab1628f6
Commit
a8feab1628f6
authored
14 years ago
by
Sylvain Thénault
Browse files
Options
Downloads
Patches
Plain Diff
should not import cw.web from entities
parent
b11900a5038e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entities.py
+0
-10
0 additions, 10 deletions
entities.py
views.py
+8
-2
8 additions, 2 deletions
views.py
with
8 additions
and
12 deletions
entities.py
+
0
−
10
View file @
a8feab16
...
...
@@ -7,11 +7,9 @@
__docformat__
=
"
restructuredtext en
"
from
cubicweb.entities
import
AnyEntity
,
fetch_config
from
cubicweb.web.views.embedding
import
IEmbedableAdapter
from
cubicweb.selectors
import
is_instance
class
Link
(
AnyEntity
):
"""
customized class for Link entities
"""
__regid__
=
'
Link
'
fetch_attrs
,
fetch_order
=
fetch_config
([
'
title
'
,
'
url
'
])
...
...
@@ -12,10 +10,9 @@
class
Link
(
AnyEntity
):
"""
customized class for Link entities
"""
__regid__
=
'
Link
'
fetch_attrs
,
fetch_order
=
fetch_config
([
'
title
'
,
'
url
'
])
def
dc_title
(
self
):
return
u
'
%s (%s)
'
%
(
self
.
title
,
self
.
url
)
...
...
@@ -23,10 +20,3 @@
if
not
self
.
embed
:
return
self
.
url
return
self
.
_cw
.
build_url
(
'
embed
'
,
url
=
self
.
url
,
rql
=
self
.
_cw
.
form
.
get
(
'
rql
'
))
class
LinkIEmbedableAdapter
(
IEmbedableAdapter
):
__select__
=
is_instance
(
'
Link
'
)
def
embeded_url
(
self
):
"""
embed action interface
"""
return
self
.
entity
.
url
This diff is collapsed.
Click to expand it.
views.py
+
8
−
2
View file @
a8feab16
...
...
@@ -12,8 +12,14 @@
from
cubicweb.selectors
import
is_instance
from
cubicweb.view
import
EntityView
from
cubicweb.web
import
uicfg
,
formwidgets
from
cubicweb.web.views
import
primary
,
baseviews
from
cubicweb.web.views
import
xbel
,
bookmark
from
cubicweb.web.views
import
primary
,
baseviews
,
xbel
,
bookmark
,
embedding
class
LinkIEmbedableAdapter
(
embedding
.
IEmbedableAdapter
):
__select__
=
is_instance
(
'
Link
'
)
def
embeded_url
(
self
):
"""
embed action interface
"""
return
self
.
entity
.
url
for
attr
in
(
'
title
'
,
'
url
'
,
'
embed
'
,
'
description
'
):
uicfg
.
primaryview_section
.
tag_attribute
((
'
Link
'
,
attr
),
'
hidden
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment