[Zope] PUT_factory to create ZWikiPage by default - help
John Hunter
jdhunter@ace.bsd.uchicago.edu
16 Apr 2001 12:28:09 -0500
Following the advice of Dieter Maurer and Tres Seaver I am trying to
use PUT_factory to override the default object type and create a
ZWikiPage when I create a page by ange-ftp. Because I am a zope and
python newbie, I am having some trouble.
I will detail what I did in hope that someone can offer me some
guidance
1) Created a 'Python (Script)' object in my Wiki folder and named it
PUT_factory with empty 'Parameter List'. This may be part of my
problem; what is the parameter list for PUT_factory? I also tried
'self, name, typ, body'
2) Added the following content to this file:
#Implement the "hookable PUT" hook.
import re, ZWikiPage
TEXT_PATTERN = re.compile( '^text/.*$' )
def PUT_factory( self, name, typ, body ):
"""
"""
if TEXT_PATTERN.match( typ ):
return ZWikiPage( source_string='', __name__=name )
return None
3) Tried to create a ZWikiPage from emacs using ange-ftp but got an
error 426.
Any advice will be appreciated.
Thanks,
John Hunter