Пример #1
0
 def update(self):
     super(PersonContactAddView, self).update()
     self.subforms = [
         ContactPersonInfoSubForm(self.context, self.request, self, None),
         ]
     for subform in self.subforms:
         subform.update()
Пример #2
0
    def update(self):
        super(AbstractEditCollectorForm, self).update()
        addform = AddToCollectorForm(self.context, self.request)
        addform.level = self.level
        addform.update()

        actions = []
        for item in self.context.objectValues():
            acts = []
            for factory in DeleteFromCollectorForm, MoveBlockForm:
                form = factory(item, self.request)
                form.update()
                form.level = self.level + 1
                acts.append(form)
            actions.append(acts)

        editforms = []
        for item in self.context.objectValues():
            subform = component.getMultiAdapter((item, self.request, self.parent_form), z3c.form.interfaces.ISubForm)
            subform.update()
            subform.level = self.level + 1
            editforms.append(subform)

        self.subforms = []
        for editform, acts in zip(editforms, actions):
            self.subforms.append(editform)
            self.subforms.extend(acts)
        self.subforms.append(addform)
Пример #3
0
    def update(self):
        super(AbstractEditCollectorForm, self).update()
        addform = AddToCollectorForm(self.context, self.request)
        addform.level = self.level
        addform.update()

        actions = []
        for item in self.context.objectValues():
            acts = []
            for factory in DeleteFromCollectorForm, MoveBlockForm:
                form = factory(item, self.request)
                form.update()
                form.level = self.level + 1
                acts.append(form)
            actions.append(acts)

        editforms = []
        for item in self.context.objectValues():
            subform = component.getMultiAdapter(
                (item, self.request, self.parent_form),
                z3c.form.interfaces.ISubForm)
            subform.update()
            subform.level = self.level + 1
            editforms.append(subform)

        self.subforms = []
        for editform, acts in zip(editforms, actions):
            self.subforms.append(editform)
            self.subforms.extend(acts)
        self.subforms.append(addform)
Пример #4
0
 def update(self):
     super(PersonContactAddView, self).update()
     self.subforms = [
         ContactPersonInfoSubForm(self.context, self.request, self, None),
     ]
     for subform in self.subforms:
         subform.update()
Пример #5
0
 def update(self):
     super(ContactEditView, self).update()
     self.subforms = []
     for relationship_info in self.context.persons.all().relationships:
         subform = ContactPersonInfoSubForm(
             self.context, self.request, self, relationship_info)
         # XXX: should also apply at least urllib.quote here:
         prefix = unicode(relationship_info.target.__name__).encode('punycode')
         subform.prefix += '.%s' % prefix
         subform.update()
         # One more hack.
         if subform.changed and self.status == self.noChangesMessage:
             self.status = self.successMessage
         self.subforms.append(subform)
Пример #6
0
 def update(self):
     super(ContactEditView, self).update()
     self.subforms = []
     for relationship_info in self.context.persons.all().relationships:
         subform = ContactPersonInfoSubForm(self.context, self.request,
                                            self, relationship_info)
         # XXX: should also apply at least urllib.quote here:
         prefix = unicode(
             relationship_info.target.__name__).encode('punycode')
         subform.prefix += '.%s' % prefix
         subform.update()
         # One more hack.
         if subform.changed and self.status == self.noChangesMessage:
             self.status = self.successMessage
         self.subforms.append(subform)
Пример #7
0
 def update_subforms(self, context, request, ignore_ctx):
     self.subforms = [
         FeaturesSubForm(context, request, self, ignore_ctx),
         BaseSubForm(context, request, self, ignore_ctx),
         EventSubForm(context, request, self, ignore_ctx),
         PlaceSubForm(context, request, self, ignore_ctx),
     ]
     [subform.update() for subform in self.subforms]