[Zope] Virtual Host Monster does not work with the absolute_url()

Jens Vagelpohl jens@zope.com
Sat, 10 Aug 2002 08:55:10 -0400


a couple things::

>     def getParent(self):
>         "Return the parent container that this object is within"
>         return self.aq_parent

if you want to ensure to always get the "physical" parent (the parent the 
object is actually situated in) then do it like this::

from Acquisition import aq_inner, aq_parent

... and in your method you say

     return aq_parent(aq_inner(self))


>     def getReports(self, type=None):
>         """
>             Returns a sequence of the immediate child Report(s)
>             in this container, sorted by title. If type is specified
>             then the results are filtered.
>         """
>
>         #get the immediate children of the container
>         children = self.objectValues()
>
>         #filter the Report(s) only
>         reports = [x for x in children if x.isInstanceOf("Report")]

make your life easier by having objectValues do the filtering for you::

   children = self.objectValues(['Report'])



jens