Re: [Zope] zclasses - changing properties
-----Original Message----- From: kedai <kdie@kedai.com.my> To: zope@zope.org <zope@zope.org> Date: Friday, September 24, 1999 6:08 AM Subject: [Zope] zclasses - changing properties
creating an instance and adding thru management interface is OK. adding thru self made form is not . there's no error. i did get the values right after the add_url_id_cons method. the url to try : www.kedai.com.my:8080/test/MiscLinks/News/add_url_id
It appears to me that it is getting added. If you go to your links page, you will notice that it displays a bunch of blank lines. This is because the MetaData in the Catalog is not getting updated, becase...
-----------------add_url_id_cons--------------- <!--#var standard_html_header--> <dtml-with "Urls.createInObjectManager(REQUEST['id'], REQUEST)">
<!--#call "propertysheets.Urls.manage_changeProperties(REQUEST)"--> </dtml-with> <dtml-call reindex_object>
The <dtml-call reindex_object> needs to happen inside the <dtml-with> block. Why? Because you need to call reindex_object on the new object. Doing it outside the with block like this, you are actually calling reindex_object on the container of the new object. Kevin
-----------------add_url_id_cons--------------- <!--#var standard_html_header--> <dtml-with "Urls.createInObjectManager(REQUEST['id'], REQUEST)">
<!--#call "propertysheets.Urls.manage_changeProperties(REQUEST)"--> </dtml-with> <dtml-call reindex_object>
The <dtml-call reindex_object> needs to happen inside the <dtml-with> block. Why? Because you need to call reindex_object on the new object. Doing it outside the with block like this, you are actually calling reindex_object on the container of the new object.
Kevin thanks kevin, but putting the <dtml-call reindex_object> after calling the <!--#call "propertysheets.Urls.manage_changeProperties(REQUEST)"--> results in the same manner. i did get the url_info added but not the properties.
what gives? another zclass Q: if i have zclasses like so: ZClassA/ZClassB/ZClassC/ZClassCproperty1 /ZClassCproperty2 how do i get the properties? trying <dtml-with "ZClassA.ZClassB"> <dtml-var "objectValues(ZClassC)"> </dtml-with> wont work because Zope cant find ZClassA and ZClassB since when creating an instance, there is no ZcClassA or ZClassB. but replacing the above code with something like: <dtml-with "instanceZClassA.instanceZClassB"> <dtml-var "objectValues(ZClassC)"> </dtml-with> does work. simply put - how do i get properties of my classes (or even other objects) thru expr? thanks a lot
The <dtml-call reindex_object> needs to happen inside the <dtml-with> block. Why? Because you need to call reindex_object on the new object. Doing it outside the with block like this, you are actually calling reindex_object on the container of the new object.
Kevin a big oops on my side. i need to use change the dtml-call to : <!--#call "propertysheets.url_info.manage_changeProperties(REQUEST)"--> ^^^^^^^^ the property sheet.
then only will the updates be accepted. all this while, i was changing the url class itself. thanks again
participants (2)
-
kedai -
Kevin Dangoor