#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    3
    Rep Power
    0

    Question zope (ZPT): here/objectValues returns nothing?


    Hi,


    I am trying to get a list of files inside a folder using ZPT. Using "here/title", I am able to get the title of the current folder just fine.

    However, when I use a repeat statement to iterate over "here/objectValues", it returns nothing, objectValues is empty. I have multiple files in that folder.

    Any thoughts as to why it is returning an empty list?

    If not, could anyone give some insight on how to print out a objects attributes or dump the object to the screen in ZPT?

    Note: it does not return an empty list when logged in, only when viewing from the web as anonymous.

    Thanks in advance for any help!
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Havn't done anything with Zope in a long while but it sounds like the folder you're trying to access is not accessable to the public i.e. is a protected by Zope.

    What folder are you trying to map? Also, is this a folder containing Zope objects/pages in the ZODB or some other folder?

    Hope this helps,

    Mark
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    Putting this into a page template works for me:
    Code:
    <p>here/objectvalues: <i tal:content="here/objectValues">object values go here</i>.</p>
    I see:

    here/objectvalues: [<ZopePageTemplate at /ZPT/test>, <ZopePageTemplate at /ZPT/formHandler>, <DTMLMethod instance at 90fa160>, <DTMLDocument instance at 9128ea8>].
    When I view that ZPT. Are you using tal:content?
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    3
    Rep Power
    0

    How to get Parent Object


    I appreciate your help.

    It actually ends up that "here" was referencing a document instead of the folder that I was in. Natrually, that document did not contain any children objects.

    So now the trouble is, how do I access the parent folder of a document (in order to retrieve all siblings of the document).

    I would like to know how to do this in ZPT. Any help on this would be much appreciated!
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    Originally Posted by lanasa
    I appreciate your help.

    It actually ends up that "here" was referencing a document instead of the folder that I was in. Natrually, that document did not contain any children objects.

    So now the trouble is, how do I access the parent folder of a document (in order to retrieve all siblings of the document).

    I would like to know how to do this in ZPT. Any help on this would be much appreciated!
    You want the container of that object. Something like this should work:
    Code:
    <span tal:content="container/objectValues" />
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.

IMN logo majestic logo threadwatch logo seochat tools logo