[Zope-dev] Python Product as DataSkin
Michael R. Bernstein
webmaven@lvcm.com
Mon, 19 Feb 2001 08:27:39 -0800
"Phillip J. Eby" wrote:
>
> At 10:47 PM 2/18/01 -0800, Michael R. Bernstein wrote:
> >
> >Hmm. So I need to refactor the 'manage_add' method inside
> >the python product into two methods, 'manage_add' which
> >would be used by the 'normal' object creation process and
> >that would also call a second 'setup' method which could be
> >called by the specialists 'myadd' method directly, bypassing
> >the 'manage_add' method entirely.
> >
> >Is that correct?
>
> Pretty much
Ok, but in that case a simple <dtml-call
"newItem(REQUEST.id)"> should at least execute without
error, and it doesn't:
Error Type: TypeError
Error Value: not enough arguments; expected 4, got 2
Traceback (innermost last):
File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 222, in publish_module
File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 187, in publish
File
/usr/local/Zope-2.2.0-src/lib/python/Zope/__init__.py, line
221, in zpublisher_exception_hook
(Object: ProviderContainer)
File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 171, in publish
File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/mapply.py,
line 160, in mapply
(Object: addArchiveImage)
File
/usr/local/Zope-2.2.0-src/lib/python/ZPublisher/Publish.py,
line 112, in call_object
(Object: addArchiveImage)
File
/usr/local/Zope-2.2.0-src/lib/python/OFS/DTMLMethod.py, line
167, in __call__
(Object: addArchiveImage)
File
/usr/local/Zope-2.2.0-src/lib/python/DocumentTemplate/DT_String.py,
line 502, in __call__
(Object: addArchiveImage)
File
/usr/local/Zope-2.2.0-src/lib/python/DocumentTemplate/DT_Util.py,
line 337, in eval
(Object: newItem(REQUEST.id))
(Info: newItem)
File <string>, line 0, in ?
File /home/webmaven/Products/ZPatterns/Specialists.py,
line 40, in newItem
(Object: ProviderContainer)
File /home/webmaven/Products/ZPatterns/Rack.py, line 73,
in newItem
(Object: ProviderContainer)
File /home/webmaven/Products/ZPatterns/Rack.py, line 135,
in createItem
(Object: ProviderContainer)
File /home/webmaven/Products/ZPatterns/Rack.py, line 232,
in _RawItem
(Object: ProviderContainer)
TypeError: (see above)
What am I doing wrong?
Michael Bernstein.