[Zope-dev] Object to string

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


Ok, maybe I was misunderstanding what Pavlos' code was intended to do
(probably because I didn't read it, just glanced at it)... try this... 

> <!--# call "manage_changeProperties(counter=counter+1)"-->
> <!--# call
> "manage_addFolder('unique'+_.str(counter),'',0,0,REQUEST)"-->
> 
(The 'PARENTS[0]' should be unnecessary. What I had suggested was
PARENTS[-1] as an alternative method of globalizing the unique ids. That
is, with PARENTS[-1] the same code could be used in five different
directories, and each id would be unique in the flat namespace inclusive
of all five. This would look like:

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


> ----------
> From: 	Jason Spisak[SMTP:webmaster@mtear.com]
> Sent: 	Tuesday, March 30, 1999 10:28 AM
> To: 	Shaw, Howard; zope-dev@zope.org
> Subject: 	Re: [Zope-dev] Object to string
> 
> Shaw,
> 
> We're close, but the id string doesn't update.
> It stays 'unique_id' instead of becoming the counter string.  
> I used this code:
> 
> <!--# call "manage_addFolder('unique_id','unique_id',0,0,REQUEST)"-->
> <!--# call "PARENTS[0].manage_changeProperties(counter=counter+1)"-->
> <!--# call "manage_changeProperties(id=_.str(counter))"-->
> 
> Thanks again for all your help, time, and extra brain cycles!
> 
> 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
>