def update(self): Span.update(self) if self.context.operational: self.relation_source = self.context.setobject self.relation = self.context RelationMixin.update(self) self.targetResource = '' if self.context.operational: self.query = super(Dropdown, self).query(query_mode=QueryMode.SHARED) self.count = self.query.count() # Is already an item selected? self.selected = False for (_, linked) in self.query: if linked == 'true': self.selected = True break
def update(self): Span.update(self) self.targetResource = "" name = grok.name.bind().get(self.__class__) if self.context.operational: self.relation_source = self.context.setobject self.relation = self.context RelationMixin.update(self) self.query = super(EmbeddedForm, self).query(query_mode=QueryMode.EXCLUSIVE) self.count = self.query.count() target_form = self.context.form_name target_plan = self.context.plan_identifier util = getUtility(ILocationProvider) genericset = util.lookup_genericset(target_plan) form = genericset.plan.forms[target_form] self.targetResource = absoluteurl.absoluteURL(form, self.request)
def __init__(self, context, request): Span.__init__(self, context, request) RelationMixin.__init__(self, show_strip=False)