Example #1
0
    def listInlineForms(self):
        ct = IContentType(self.context)

        forms = []
        datasheets = {}
        for schId in ("content.item",) + tuple(self.context.schemas):
            schema = queryUtility(storage.ISchema, schId)
            if schema is not None:
                ds = schema.Type()
                datasheets[schema.name] = ds
                form = EditDatasheet(ds, self.request, self)
                if schId == "content.item":
                    form.hidden = "type", "modified", "created"
                if schId in ct.hiddenFields:
                    form.hidden = ct.hiddenFields[schId]
                if schId in ct.widgets:
                    form.widgetFactories = ct.widgets[schId]
                form.update()
                forms.append((schId, form))

        self.datasheets = datasheets

        forms.extend(super(AddContent, self).listInlineForms())
        return forms
Example #2
0
    def listInlineForms(self):
        ct = self.context
        request = self.request

        forms = []
        datasheets = {}
        for schId in ct.schemas:
            schema = content.querySchema(schId)
            if schema is not None:
                ds = schema.Type()
                datasheets[schema.name] = ds

                form = DatasheetEdit(ds, request, self)

                #form = getMultiAdapter((ds, request), IDatasheetForm)
                #if schId in ct.widgets:
                #    form.widgetFactories = ct.widgets[schId]
                form.update()
                forms.append((schId, form))

        self.datasheets = datasheets

        forms.extend(super(AddContentForm, self).listInlineForms())
        return forms