Am 02.05.2008 um 13:50 schrieb yuppie:

Did some more refactoring. If your factory can handle all the input, ContentAddFormBase's 'create' method should be sufficient. If not, you need a 'create' method like the one in FileAddView.

Done quite a lot of Add Forms based on your work and we ended up extended the base view to implement form_fields and require the sub classes to provide the portal_type and the schema or list of fields.

    def form_fields(self):
        fields = form.FormFields(
        # allow sub-classes to pass in sequences of schema
        if isinstance(list, self.schema):
            for s in self.schema:
                fields += form.FormFields(s)
            fields += form.FormFields(self.schema)
        return fields

I'm not sure if it's overkill to be able to handle a list of fields but we've found it makes views a lot easier to work with. What do you think?

Charlie Clark
Helmholtzstr. 20
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226

Zope-CMF maillist  -

See for bug reports and feature requests

Reply via email to