manage_changeProperties self help
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... Thanks for the hint. -Trevor
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
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 )
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 )
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 )
David Kyte writes:
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' ) And you are sure, that "context" is the object with "counter" as property?
If this is not the case, then you can get "counter" by acquisition, but "manage_changeProperty" may come from another object without a "counter" property. I can assure you: "manage_changeProperties" usually works as it should... Dieter
I think so, I am using a url http://localhost:8080/notes/Notes/NewNote The counter is a property of the Notes folder and the NewNote python script is in the notes directory. Would I be right in thinking that I use n=context.counter Cos if I do it works, if I kick out the context ie n=counter zope bletches Thanks David Kyte -----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: 14 February 2002 21:59 To: David Kyte Cc: Trevor Toenjes; Bakhtiar Abdul Hamid; zope@zope.org Subject: RE: [Zope] manage_changeProperties self help David Kyte writes:
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' ) And you are sure, that "context" is the object with "counter" as property?
If this is not the case, then you can get "counter" by acquisition, but "manage_changeProperty" may come from another object without a "counter" property. I can assure you: "manage_changeProperties" usually works as it should... Dieter
David Kyte writes:
... "manage_changeProperties" does not work in Python Script ... I just created the following Python Script "addToPi" in folder "Test" (which has property "pi"):
context.manage_changeProperties(pi=context.pi+1) return 'ok' When activated through: http://localhost:8080/Test/addToPi it works perfectly. If it does not for you, then debugging "manage_changeProperties" might be the right approach... You would add "import pdb; pdb.set_trace()" in "OFS.PropertyManager.manage_changeProperties", restart Zope, activate your failing script. Zope will stop in the debugger. You can single step and see what goes wrong. Dieter
participants (4)
-
Bakhtiar Abdul Hamid -
David Kyte -
Dieter Maurer -
Trevor Toenjes