[Zope-dev] Re: __str__, DMTLFolder adn Squishdot]

Andy McKay andym@ActiveState.com
Thu, 21 Sep 2000 10:21:07 -0700


Yeah I'll do what works for now and make a science project out of it one
rainy weekend.

Part of the problem could be the API for instantiation of folderish objects
and DTML objects.
A DTML method is created:

DTMLMethod(file, __name__=id).

A folder is

ob = Folder()
ob.id = str(id)

Or something like that. Its in my source somewhere with nasty comments
around it :)

----- Original Message -----
From: "Chris Withers" <chrisw@nipltd.com>
To: <zope-dev@zope.org>; "Andy McKay" <andym@activestate.com>
Sent: Thursday, September 21, 2000 9:44 AM
Subject: [Fwd: __str__, DMTLFolder adn Squishdot]


> Andy McKay wrote:
> >
> > > Andy McKay wrote:
> > > > I've given it a __call__ method, but not a __str__. Ive most
problems
> > > > resolve around the objects name, absolute_url, __name__, so perhaps
> > fiddling
> > > > with __str__ might be an answer.
> > >
> > > Sorry, but none of that made sense... What are the actual problems
> > > you're having with names, absolute_url and __name__?
> >
> > This is probably not going to make much sense.... but you can create a
> > folderish DTML Document and on the surface it appears fine. However
cracks
> > appear when you:
> >
> > - view it in a tree
> > - copy and paste
> > - catalog
> >
> > The reason being that the absolute_url of the object is wrong, it
sometimes
> > comes out as http://fork:8080/a/b/c/ElementWithAttributes. In some cases
> > (cut and paste) __name__ is called, and that comes out wrong too.
>
> Now that is weird. Can anyone shed any light on what's going on here?
>
> > Ive given up on this now, I have an object and if I want some folderish
> > objects created tied to that object, I create a folder and do the
storage in
> > that and it works fine.
>
> That's probably going to be your best bet in the long run,
>
> cheers,
>
> Chris
>