[Zope-dev] Object to string

Shaw, Howard ShawH@STHS.org
Tue, 30 Mar 1999 12:44:23 -0600


Nope. Nothing wrong here. Just wrap the two instances of unique_id in
quotes. Sorry for not catching that in Pavlos' code.

like so:
> <!--# call "manage_addFolder('unique_id','unique_id',0,0,REQUEST)"-->
the fields are id and title, and both take a string. The traceback was
telling you that it could not find the object unique_id which it was
trying to evaluate to generate a string to pass.

Howard C. Shaw III
Programmer/SysAdmin
St. Thomas High School


> ----------
> From: 	Jason Spisak[SMTP:webmaster@mtear.com]
> Sent: 	Tuesday, March 30, 1999 9:02 AM
> To: 	Shaw, Howard; zope-dev@zope.org
> Subject: 	Re: [Zope-dev] Object to string
> 
> Maybe their's something wrong with my Zope, but I can't get the
> manage_addFolder to work by itself, let alone with properties from a
> root folder. Odd.  It try this code:
> 
> <!--# call "manage_addFolder(unique_id,unique_id,0,0,REQUEST)"-->
> 
> This should create a folder at that level of the hirearchy with id of
> 'unique_id', but instead I get this traceback--
> 
> 
> <!--
> Traceback (innermost last):
>   File lib/python/ZPublisher/Publish.py, line 877, in publish_module
>   File lib/python/ZPublisher/Publish.py, line 590, in publish
>     (Info: /staff/test)
>   File lib/python/OFS/DTMLMethod.py, line 155, in __call__
>     (Object: test)
>   File lib/python/OFS/DTMLMethod.py, line 151, in __call__
>     (Object: test)
>   File lib/python/DocumentTemplate/DT_String.py, line 513, in __call__
>     (Object: test)
>   File lib/python/DocumentTemplate/DT_Util.py, line 266, in eval
>     (Object: manage_addFolder(unique_id,unique_id,0,0,REQUEST))
>   File &lt;string&gt;, line 0, in ?
> NameError: (see above)
> 
> -->)
> 
> 
> Can I not give the name 'unique_id' to a new folder?
> 
> Jason Spisak
> webmaster@mtear.com
> 
> Shaw, Howard wrote:
> > 
> > Sorry, guess I wasn't clear enough. What I am thinking should work
> is
> > ...
> > 
> > <!--# call
> > "PARENTS[0].manage_addFolder(unique_id,unique_id,0,0,REQUEST)"-->
> > <!--# call
> "PARENTS[0].manage_changeProperties(counter=counter+1)"-->
> > <!--# call
> >
> "PARENTS[0].manage_changeProperties(unique_id='MyFolder'+_.str(counter
> ))
> > "-->
> > 
> > Howard C. Shaw III
> > Programmer/SysAdmin
> > St. Thomas High School
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://www.zope.org/mailman/listinfo/zope-dev
> 
> (For non-developer, user-level issues, use the companion list,
> zope@zope.org, http://www.zope.org/mailman/listinfo/zope )
>