[Zope-dev] Object to string

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


WARNING!

If you happen to add any item with id 'counter' anywhere between the
toplevel folder and where you are this will break. It would be safer to
refer explicitly to the toplevel counter object. Try something like
this. (Again, I apologise for misreading the intent of Pavlos' code.)

> <!--# call
> "manage_addFolder(_.str(PARENTS[-1].counter),_.str(PARENTS[-1].counter
> ),0,0,REQUEST)"-->
> <!--# call "PARENTS[-1].manage_changeProperties(counter=counter+1)"-->
> 
> 
Howard C. Shaw III
Programmer/SysAdmin
St. Thomas High School


> ----------
> From: 	Jason Spisak[SMTP:webmaster@mtear.com]
> Sent: 	Tuesday, March 30, 1999 10:36 AM
> To: 	Shaw, Howard
> Subject: 	Re: [Zope-dev] Object to string
> 
> I got it!
> 
> Quick follow-up
> 
> The id has to be changed with either 
>          1)another method besides manage_changeProperties, or
> <my choice>
> 	2)given the value of the counter from the start
> </my choice>
> 
> I ended up using
> 
> <!--# call
> "manage_addFolder(_.str(counter),_.str(counter),0,0,REQUEST)"-->
> <!--# call "PARENTS[-1].manage_changeProperties(counter=counter+1)"-->
> 
> Thanks for all the help.
> I'll buy you guys all a beer if the boss gives me a raise in my food
> stamps $-)
> 
> All the best,
> 
> Jason Spisak
> webmaster@mtear.com
> 
> 
> Shaw, Howard wrote:
> > 
> > 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
> > 
> -- 
> Jason Spisak
> webmaster@mtear.com
>