[components] add missing imports for code copied/pasted. Forgot to run pylint afterward...
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 14 Oct 2010 10:08:00 +0200
changeset 6490 34359fbde6ef
parent 6489 6ea74c34fc25
child 6491 ee9a10b6620e
[components] add missing imports for code copied/pasted. Forgot to run pylint afterward...
web/box.py
web/component.py
--- a/web/box.py	Thu Oct 14 09:49:59 2010 +0200
+++ b/web/box.py	Thu Oct 14 10:08:00 2010 +0200
@@ -23,7 +23,7 @@
 from logilab.mtconverter import xml_escape
 from logilab.common.deprecation import class_deprecated, class_renamed
 
-from cubicweb import Unauthorized, role as get_role, target as get_target
+from cubicweb import Unauthorized, role as get_role
 from cubicweb.schema import display_name
 from cubicweb.selectors import no_cnx, one_line_rset
 from cubicweb.view import View
--- a/web/component.py	Thu Oct 14 09:49:59 2010 +0200
+++ b/web/component.py	Thu Oct 14 10:08:00 2010 +0200
@@ -27,7 +27,8 @@
 from logilab.common.deprecation import class_deprecated, class_renamed
 from logilab.mtconverter import xml_escape
 
-from cubicweb import Unauthorized, role, tags
+from cubicweb import Unauthorized, role, target, tags
+from cubicweb.schema import display_name
 from cubicweb.uilib import js, domid
 from cubicweb.utils import json_dumps
 from cubicweb.view import ReloadableMixIn, Component
@@ -35,7 +36,7 @@
                                 non_final_entity, partial_relation_possible,
                                 partial_has_related_entities)
 from cubicweb.appobject import AppObject
-from cubicweb.web import htmlwidgets, stdmsgs
+from cubicweb.web import INTERNAL_FIELD_VALUE, htmlwidgets, stdmsgs
 
 
 # abstract base class for navigation components ################################
@@ -362,7 +363,7 @@
 class EditRelationMixIn(ReloadableMixIn):
     def box_item(self, entity, etarget, rql, label):
         """builds HTML link to edit relation between `entity` and `etarget`"""
-        args = {role(self)[0] : entity.eid, get_target(self)[0] : etarget.eid}
+        args = {role(self)[0] : entity.eid, target(self)[0] : etarget.eid}
         url = self._cw.user_rql_callback((rql, args))
         # for each target, provide a link to edit the relation
         return u'[<a href="%s">%s</a>] %s' % (xml_escape(url), label,