[Zope] wiki manager

robert rottermann robert at redcor.ch
Sun Jul 25 02:44:02 EDT 2004


Looking trough your code I see no obvious mistake.

if you want to have the value of an input field automatically assigned 
you have use parameters with your script. Their names must correspond 
with the names of your input fields.
So in your sample you would call the parameter "name" and the you can do 
the following assignment:
wikiname=name
If you would name your input field "wikiname" and your parameter the 
same, that assignment would be not be necessary.

Robert

Pupeno wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I'm creating a page where users, after logging in, can freely create wikis 
> based on ZWiki.
> I have a lot of doubts, but I'll start with the beggining.
> I come from PHP so, my method of working might be wrong and I want to check 
> with you.
> I have a Template Page called 'my' that gives some status for the user (is 
> supoused to list the wikis that belong to the user and show administrative 
> tools), the main administrative tool is, create a wiki. And that's what I'm 
> working on. I have the following form there:
> <form action="createWiki" method="get">
> 	Name of the wiki: <input type="text" id="name" />
> 	<input type="submit" label="Create!" />
> </form>
> and then, I have the script 'createWiki':
> # Import a standard function, and get the HTML request and response objects.
> from Products.PythonScripts.standard import html_quote
> request = container.REQUEST
> RESPONSE =  request.RESPONSE
> 
> wikiName = request.get('name', 'wiki')
> 
> # Add the wiki
> wikisFolder = context.restrictedTraverse('wikis')
> wikisFolder.manage_addProduct['OFSP'].manage_addFolder(wikiName, wikiName)
> newWikiFolder = wikisFolder.restrictedTraverse(wikiName)
> newWikiFolder.manage_addProduct['ZWiki'].manage_addZWikiPage(wikiName, 
> wikiName)
> 
> why doesn't wikiName get's the input var ? and then... is this the right way 
> to do it ?
> At the end, this script should redirect back to the my page or to the wiki... 
> is that ok ?
> Thanks.
> - -- 
> Pupeno: pupeno at pupeno.com - http://www.pupeno.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> 
> iD8DBQFBA0mzfW48a9PWGkURApgVAJ4+KIcgHkdIy13/Y1ld94VCbYCKLwCeLonw
> IkGjMSAfyD6AlO/R95HwHp8=
> =j4ud
> -----END PGP SIGNATURE-----
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 
> 


More information about the Zope mailing list