Loading ...
Sorry, an error occurred while loading the content.

Re: [zms-developers] AttributeError: aq_parent on images in Data table (on ZMS content root object)

Expand Messages
  • Niels Dettenbach
    ... Just in addition: sorry for coming back with this again, but it seems there still is a small bug in the current tree here. I ve further investigated with
    Message 1 of 3 , Dec 22, 2011
    View Source
    • 0 Attachment
      Am Freitag, 21. Oktober 2011, 15:06:03 schrieben Sie:
      > If no one has a similiar problem i assume it is affected by anything within
      > my setup here.
      Just in addition:

      sorry for coming back with this again, but it seems there still is a small bug in the current tree here. I've further investigated with todays current that my code should be correct, as i still get parameters of the image blob - like i.e.:

      <dtml-var expr="img.getWidth()">
      <dtml-var expr="img.getFilename()">

      but if i call a

      <dtml-var expr="img.getFilename(REQUEST)">

      i still get a

      --- snip ---
      in File "/var/zope/abc/Products/zms/_blobfields.py", line 735, in getHref parent = self.aq_parent AttributeError: aq_parent
      --- snap ---

      again (as in older versions of 2.13).


      Here is the code i use (i have a table of 52 images by kw_id - one image per week of the year) and want to show another image each week of year in this case:

      <dtml-let doc="content">
      <dtml-let weekofyear="DateTime().week()">
      <dtml-let images="filter_list(doc.bg_images_zms.getObjProperty('records',REQUEST),'kw_id',weekofyear)">
      <dtml-if images>
      <dtml-in images mapping>
      <dtml-let image="formatObjAttrValue(getObjAttr('kw_image'),kw_image, lang)">
      <dtml-call "REQUEST.set('img',image)">
      </dtml-let>
      </dtml-in>
      <dtml-else>
      <dtml-call "REQUEST.set('img',doc.getObjProperty('bg_image_default',REQUEST))">
      </dtml-if>
      <dtml-with content>
      <dtml-var expr="img.getHref(REQUEST)">
      </dtml-with>
      </dtml-let>
      </dtml-let>
      </dtml-let>


      May be this is a likely hidden bug as not much users may use table objects on the ZMS object (ZMS root) - we may solve this by workarounds like using 1-n objects instead of a table, but for proper functionality and completeness this should work too i think.

      Unfortunately i can't figure out the problem within the ZMS code byself here and cant build the path byself from other parts (i.e. getFilename()) as i did not have the (changing) path......

      May be someone will be faced to the same problem at some time in the future...


      best regards,


      Niels.
      --
      ---
      Niels Dettenbach
      Syndicat IT&Internet
      http://www.syndicat.com/
    Your message has been successfully submitted and would be delivered to recipients shortly.