Addendum on: Why isn't my Python script updating my properties? (code included)
I wrote:
In its current form (more below on that), the script doesn't give an error, but neither does it update any of the other properties.
I didn't expand on that. Basically, the manage_changeProperties are being excuted without error, but if I try to do that with the NewMenuSection property, for some reason I do get an error from Zope. For that reason, the NewMenuSection line is commented out in my script, although my e-mailer is wrapping right after the # that comments it out in the code. The pertinent section is below: =========== excerpt from SiteSection_edit_general ============== # ----- NewMenuSection # why is it failing here? # commented out but wrapping - context.manage_changeProperties(NewMenuSection=request['NewMenuSection']) ===================== end excerpt ============================ Many thanks, Am Thomas --- Virtue of the Small http://virtueofthesmall.com
Have you tried inserting the name of your property sheet into the line as so... context.your_property_sheet_name.manage_changeProperties(NewMenuSection=REQU EST['NewMenuSection']) hth Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of A M Thomas Sent: Thursday, March 21, 2002 12:21 PM To: zope@zope.org Subject: [Zope] Addendum on: Why isn't my Python script updating my properties? (code included) I wrote:
In its current form (more below on that), the script doesn't give an error, but neither does it update any of the other properties.
I didn't expand on that. Basically, the manage_changeProperties are being excuted without error, but if I try to do that with the NewMenuSection property, for some reason I do get an error from Zope. For that reason, the NewMenuSection line is commented out in my script, although my e-mailer is wrapping right after the # that comments it out in the code. The pertinent section is below: =========== excerpt from SiteSection_edit_general ============== # ----- NewMenuSection # why is it failing here? # commented out but wrapping - context.manage_changeProperties(NewMenuSection=request['NewMenuSection']) ===================== end excerpt ============================ Many thanks, Am Thomas --- Virtue of the Small http://virtueofthesmall.com _______________________________________________ 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 Laurie, That was almost right - and I figured it out with your help! This worked: context.propertysheets.SiteSection.manage_changeProperties(..... I think I tried something similar earlier, having done something like this before, but maybe I capitalized PropertySheets. Thank you very much! I also figured out the problem with that one property, NewMenuSection. It's being set by a checkbox; if the box is unchecked, I was getting an exception when it referred to request['NewMenuSection']. I guess those booleans need to be radio buttons? Anyway, thank you for your help - I'm almost sane again. - Am Laurie Nason wrote:
Have you tried inserting the name of your property sheet into the line as so...
context.your_property_sheet_name.manage_changeProperties(NewMenuSection=REQU EST['NewMenuSection'])
hth
Laurie
participants (2)
-
A M Thomas -
Laurie Nason