Skip to content
Snippets Groups Projects
Commit b109aca28c9f authored by Stephanie Marcu's avatar Stephanie Marcu
Browse files

remove cw 3.9 deprecation warnings

parent a235ae9a5c2a
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
Architecture: all
Conflicts: erudi-link, erudi-link-server, erudi-link-client, erudi-link-comp
Replaces: erudi-link, erudi-link-server, erudi-link-client, erudi-link-comp
Depends: cubicweb-common (>= 3.8.0)
Depends: cubicweb-common (>= 3.9.0)
Description: link component for the CubicWeb framework
This CubicWeb component provides links (a URL with a description).
.
......
......@@ -7,11 +7,10 @@
__docformat__ = "restructuredtext en"
from cubicweb.entities import AnyEntity, fetch_config
from cubicweb.interfaces import IEmbedable
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'])
......@@ -13,11 +12,10 @@
class Link(AnyEntity):
"""customized class for Link entities"""
__regid__ = 'Link'
fetch_attrs, fetch_order = fetch_config(['title', 'url'])
__implements__ = (IEmbedable,)
def dc_title(self):
return u'%s (%s)' % (self.title, self.url)
......@@ -19,14 +17,10 @@
def dc_title(self):
return u'%s (%s)' % (self.title, self.url)
def embeded_url(self):
"""embed action interface"""
return self.url
def actual_url(self):
if not self.embed:
return self.url
return self._cw.build_url('embed', url=self.url, rql=self._cw.form.get('rql'))
......@@ -28,5 +22,11 @@
def actual_url(self):
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
from cubicweb.selectors import implements
from cubicweb.selectors import is_instance
from cubicweb.sobjects.notification import ContentAddedView
class LinkAddedView(ContentAddedView):
"""get notified from new links"""
......@@ -2,6 +2,6 @@
from cubicweb.sobjects.notification import ContentAddedView
class LinkAddedView(ContentAddedView):
"""get notified from new links"""
__select__ = implements('Link')
__select__ = is_instance('Link')
content_attr = 'description'
LINK_ICON = DATADIR/icon_link.gif
LINK_ICON = data('icon_link.gif')
......@@ -9,7 +9,7 @@
from logilab.mtconverter import html_escape
from cubicweb.selectors import implements
from cubicweb.selectors import is_instance
from cubicweb.view import EntityView
from cubicweb.web import uicfg, formwidgets
from cubicweb.web.views import primary, baseviews
......@@ -23,7 +23,7 @@
class LinkPrimaryView(primary.PrimaryView):
__select__ = implements('Link')
__select__ = is_instance('Link')
show_attr_label = False
def render_entity_title(self, entity):
......@@ -37,7 +37,7 @@
class LinkOneLineView(baseviews.OneLineView):
__select__ = implements('Link')
__select__ = is_instance('Link')
def cell_call(self, row, col):
entity = self.cw_rset.complete_entity(row, col)
......@@ -56,7 +56,7 @@
class LinkView(EntityView):
__regid__ = 'link'
__select__ = implements('Link')
__select__ = is_instance('Link')
title = _('link')
def cell_call(self, row, col):
......@@ -69,10 +69,10 @@
% values)
class XbelItemLinkView(xbel.XbelItemView):
__select__ = implements('Link')
__select__ = is_instance('Link')
def url(self, entity):
return entity.url
class LinkFollowAction(bookmark.FollowAction):
......@@ -73,7 +73,7 @@
def url(self, entity):
return entity.url
class LinkFollowAction(bookmark.FollowAction):
__select__ = implements('Link')
__select__ = is_instance('Link')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment