43
43
# Defaults to self.vocabulary.displayname.
47
def widget_rendered(self):
48
# We manually create the widget name since we don't want different
49
# popups colliding, and we have to put the attr on the request so all
50
# instances of the popup on this request can check the attr.
51
attr = self.__class__.__name__ + '_rendered'
52
if hasattr(self.request, attr):
53
return getattr(self.request, attr)
55
# The widget has not rendered before this. We return False, but
56
# set the attribute to true, so future checks will see that it
57
# has rendered. It would be better to set this in __init__ or
58
# similar, but then this first check also sees True, and we never
59
# render the part of the template this is used to guard.
60
setattr(self.request, attr, True)
63
@widget_rendered.setter
64
def widget_rendered(self, val):
65
attr = self.__class__.__name__ + '_rendered'
66
setattr(self.request, attr, val)
70
48
"""Return a list of matches (as ITokenizedTerm) to whatever the