[Zope] manage_changeProperties self help

Trevor Toenjes zope@toenjes.com
Thu, 14 Feb 2002 11:21:50 -0500


The solution was _.getitem(getId()) to call the equivalent of <dtml-var id>
as in...
<dtml-call expr="_.getitem(getId()).change_manageProperties(hits=hits+1)">

I shoulda used pscript, but not worth it for 1 line of code.

David,
try self...or parent.  just guessing.


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of David
> Kyte
> Sent: Thursday, February 14, 2002 10:00 AM
> To: Trevor Toenjes; Bakhtiar Abdul Hamid
> Cc: zope@zope.org
> Subject: RE: [Zope] manage_changeProperties self help
>
>
>
> Hi,
>
> I have a similar problem - except using a python script.
> The counter property is in the paren folder.
>
> n = context.counter
> n=n+1
> context.manage_changeProperties( counter=n )
>
> context.manage_addDocument( 'N' + str(n) , '' )
>
> return RESPONSE.redirect( 'MainNotes' )
>
>
> Any ideas.
>
> PS Using 2.3.0 - also addDocument generates a dtml method
> not docuement
>
> TIA
>
> Dave
>
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Trevor Toenjes
> Sent: 14 February 2002 14:15
> To: Bakhtiar Abdul Hamid; Trevor Toenjes
> Cc: zope@zope.org
> Subject: RE: [Zope] manage_changeProperties self help
>
>
> Thanks.  but no dice on that either.
> <dtml-call "_.getitem(id).manage_changeProperties(hits=hits+1)">
> <dtml-call "_.getitem(aq_parent).manage_changeProperties(hits=hits+1)">
> and
> <dtml-call "_.getId().manage_changeProperties(hits=hits+1)">
> do not work.
> I am just guessiing now...
>
> -Trevor
>
>
> > -----Original Message-----
> > From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> > Bakhtiar Abdul Hamid
> > Sent: Thursday, February 14, 2002 4:29 AM
> > To: Trevor Toenjes
> > Cc: zope@zope.org
> > Subject: Re: [Zope] manage_changeProperties self help
> >
> >
> > On Thu, 14 Feb 2002, Trevor Toenjes wrote:
> >
> > > banging my head here...
> > > <dtml-call "manage_changeProperties(hits=hits+1)"> is in a method
> > >
> > > I have looked at  aq, self(), id(), etc., but nothing works.
> > > Explicitly calling the Document, works,
> > > <dtml-call "myDoc.manage_changeProperties(hits=hits+1)">
> > > but I need to script it...
> >
> > if you're getting the document dynamically, try
> >
> > <dtml-call
> > "_[mydoc_id_or_something].manage_changeProperties(hits=hits+1)">
> >
> > or
> > <dtml-call
> > "_.getitem(mydoc_id_or_something).manage_changeProperties(hits=hits+1)">
> >
> > where you supply the doc id whichever way fits
> >
> > hth
> > >
> > > Thanks for the hint.
> > > -Trevor
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Zope maillist  -  Zope@zope.org
> > > http://lists.zope.org/mailman/listinfo/zope
> > > **   No cross posts or HTML encoding!  **
> > > (Related lists -
> > >  http://lists.zope.org/mailman/listinfo/zope-announce
> > >  http://lists.zope.org/mailman/listinfo/zope-dev )
> > >
> >
> > --
> >      test
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )