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

Tom Cameron tom@mooball.com
Sat, 10 Aug 2002 21:26:23 +1000


Chris,

We start with a base class called GenericObject...
class GenericObject(Implicit, Persistent, RoleManager, Item,
PropertyManager, MessageListener):

It contains, amongst others, the following method (the only one in the
entire product that uses a aq_ method)

    #---------------------------------------------------------------#

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

    #---------------------------------------------------------------#

>From there we create several other base classes and sub off them a few
times.

The product presently has about 40 classes with about 8 base classes from
which all others are built.

To narrow it down for you a bit. There is a container called a Model and it
contains Reports. and it is the reports that I am getting the URL of. To get
the list of reports I use the following method of the model...

    #---------------------------------------------------------------#

    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")]

        if type != None:
            reports = [x for x in reports if x.getReportType() == type]

        #sort the report by Report.getTitle()
        reports.sort(lambda x, y : x.getTitle() < y.getTitle())

        return reports

    #---------------------------------------------------------------#


This returns a list and then i do the .absolute_url() on each of these.

Could it be the way I get the reports?

Tom


=> -----Original Message-----
=> From: Chris Withers [mailto:chrisw@nipltd.com]
=> Sent: Saturday, 10 August 2002 9:03 PM
=> To: tom@mooball.com
=> Cc: Evan Simpson; zope@zope.org
=> Subject: Re: [Zope] Virtual Host Monster does not work with the
=> absolute_url()
=>
=>
=> Tom Cameron wrote:
=> > Evan,
=> > it is a python product that I have built, it is subclassed on another
=> > abstract class I built and the simpleItem class.
=> >
=> > None of my classes redefine the absolute_url() method - or for
=> that matter
=> > any related methods.
=>
=> Do any of your products do anything which might affect the acquisiton
=> cotext of their children? (using any of the aq_ methods, using
=> dictionries instead of attributes, etc...)
=>
=> cheers,
=> Chris
=>