Am 25.04.2008 um 19:23 schrieb Charlie Clark:
Agreed. The first five lines are generic and should probably be in
ContentAddFormBase leaving just the adapter stuff to be implemented
by the view itself which is what is was before! _create would be
more in keeping with other formlib methods such as handle_success
I've been successfully able to implement my own add Views for some of
my own objects and it definitely makes sense to have let
contentAddView do the work. For my objects I don't seem to need
anything specific in the view so always implementing a method such has
_create or maybe _handle_add doesn't make sense. Maybe a lookup to see
if such a method is implemented for adapting any additional adaptation?
if hasattr(self, "adapt_form_to_object"):
Regarding naming: I suppose the easiest thing is to add an "id"
field to the add form for none file objects. It would be nice to
have a "require once" in the schema value for things like upload
fields so that the same schema can be used for adding and editing.
Ha, should have looked more closely at the code! You're automatically
generating names as required. Maybe the lookup should also cope with
forms where an id is supplied just as you've done with filenames?
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests