I want to create a large number of properties for a Zclass. My Zclass has a propertysheet named Schedule. I've tried stuff like this: <dtml-with propertysheets> <dtml-with common> <dtml-with Schedule> manage_addProperty(name='foo', value='bar', type='string') </dtml-with> </dtml-with> </dtml-with> The <dtml-with>'s don't get an error, so I must be popping namespaces on properly. But the manage_addProperty always results in: invalid attribute name, "manage_addproperty(name", for tag <dtml-call manage_addProperty(name='foo', value='bar', type='string')>, on line 10 of makeSched =Rob====== ====J===== =====Roos= And more and more, as I see all these prisons going up, and everybody being sent off to prison, with three strikes and so on, they are preparing, really, for a showdown with the American people. They're already talking about housing for minor drug offenders the old Army camps that are being shut down. To pen them in. More animal farming. The animals are going to turn one day and bite. And even now, perhaps, as we are chatting, there is some young boy or girl who will grow up and overthrow this government. Because it has overthrown our old republic; it seems to be doing its best to overthrow our Bill of Rights and the Constitution ... -Gore Vidal, novelist, essayist, and cousin of Al Gore 1996 interview on "We the People" with Jerry Brown <www.wtp.org/radio/transcripts/tr960708.html>
Hi Rob, I'm a newbie, but I just finished doing what you are trying to do. Here's how I did it: Product name: NewsItem ZClass: CNewsItem Property Sheet: NewsProperties In the BuildNews dtml method: <dtml-call "REQUEST.set('ts', ZopeTime())"> <dtml-call "REQUEST.set('id', _.str(_.int(ts)))"> <dtml-with "manage_addProduct['NewsItem']"> <dtml-call "CNewsItem_add(_.None, _, NoRedir=1)"> </dtml-with> <dtml-with "_.getitem(REQUEST['id']).propertysheets.NewsProperties"> <dtml-call "manage_changeProperties({ 'PostedBy' : REQUEST['PostedBy'], 'email' : REQUEST['email'], 'Title' : REQUEST['Title'], 'Content' : REQUEST['Content'], 'Expires' : REQUEST['Expires'], 'IconPath' : REQUEST['IconPath'], 'DetailURL' : REQUEST['DetailURL'], 'DetailDescription' : REQUEST['DetailDescription']})"> </dtml-with> <dtml-call "RESPONSE.redirect(URL2)"> Hope it helps. Eric. // I want to create a large number of properties for a Zclass. // My Zclass has a propertysheet named Schedule. // // I've tried stuff like this: // // <dtml-with propertysheets> // <dtml-with common> // <dtml-with Schedule> // manage_addProperty(name='foo', value='bar', type='string') // </dtml-with> // </dtml-with> // </dtml-with> // // // The <dtml-with>'s don't get an error, so I must be popping namespaces on // properly. But the manage_addProperty always results in: // // invalid attribute name, "manage_addproperty(name", for tag <dtml-call // manage_addProperty(name='foo', value='bar', type='string')>, on // line 10 of makeSched // // // =Rob====== // ====J===== // =====Roos=
Robert Joseph Roos wrote:
invalid attribute name, "manage_addproperty(name", for tag <dtml-call manage_addProperty(name='foo', value='bar', type='string')>, on line 10 of makeSched
don't know if anybody helped you on this already, but any method call is an expression, and should be (pedantically) spelled: <dtml-call expr="manage_addProperty(name='foo',value='bar', type='string')"> hope that helps, -- -mindlace- Zopatista Community Liason
participants (3)
-
Eric Walstad -
ethan mindlace fremen -
Robert Joseph Roos