--- a/views/formwidgets.py Mon Aug 31 15:07:38 2015 +0200
+++ b/views/formwidgets.py Tue Sep 22 11:37:12 2015 +0200
@@ -23,7 +23,8 @@
from logilab.mtconverter import xml_escape
from cubicweb import tags
-from cubicweb.web import formwidgets as fwdgs
+from cubicweb.web import (formwidgets as fwdgs,
+ INTERNAL_FIELD_VALUE)
class TreeViewWidget(fwdgs.FieldWidget):
"""form widget to link to keywords of a given classification"""
@@ -92,7 +93,7 @@
"""filter the rset to only get the root entities"""
vocab = field.vocabulary(form)
if vocab:
- entities = [form._cw.entity_from_eid(i[1]) for i in vocab]
+ entities = [form._cw.entity_from_eid(i[1]) for i in vocab if i[1] != INTERNAL_FIELD_VALUE]
eids = ', '.join(str(e.eid) for e in entities
if e.cw_adapt_to('ITree') and e.cw_adapt_to('ITree').is_root())
return form._cw.execute('Any X WHERE X eid IN (%(e)s)' % {'e':eids})