[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - add.py:1.14

Tres Seaver tseaver@zope.com
Wed, 26 Mar 2003 05:43:54 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv20342/src/zope/app/browser/form

Modified Files:
	add.py 
Log Message:
 - Make 'content_factory' optional, per spec in meta.zcml.

=== Zope3/src/zope/app/browser/form/add.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/browser/form/add.py:1.13	Tue Mar 25 11:30:23 2003
+++ Zope3/src/zope/app/browser/form/add.py	Wed Mar 26 05:43:54 2003
@@ -158,7 +158,7 @@
     provideView(for_, name, IBrowserPresentation, class_, layer)
 
 
-def add(_context, name, schema, content_factory, label='',
+def add(_context, name, schema, content_factory='', label='',
         permission = 'zope.Public', layer = "default",
         class_ = None, for_ = 'zope.app.interfaces.container.IAdding',
         template = None, omit=None, fields=None,
@@ -180,7 +180,8 @@
         actions = []
 
 
-    content_factory = _context.resolve(content_factory)
+    content_factory = (content_factory and _context.resolve(content_factory)
+                       or None)
 
     (schema, for_, bases, template, fields,
      ) = _normalize(