Am I totally off my head or is it possible to make a Folderish DTML Document. I had a thread on zope-dev got no response. I know Chris Withers thinks every object is a folderish one, but Im talking about using PropertyManager, ObjectManager and DTMLMethod all on one object. The main problem being absolute_url on the object seems to be broken. -- Andy McKay, Developer. ActiveState.
Well here's my proclamation. It cant be done... you cant have a Folderish, DTMLMethod without doing any major rewrites of code. Looking at that old favorite Squishdot, it seems the postings are all just stuck in one folder and you rewrite whole bunches of bits. Im going to look at it more tonight, but Chris if you are out there any insight would be helpful. ----- Original Message ----- From: "Andy McKay" <andym@ActiveState.com> To: <zope@zope.org> Sent: Tuesday, September 19, 2000 5:19 PM Subject: [Zope] Folderish DTML Document
Am I totally off my head or is it possible to make a Folderish DTML Document. I had a thread on zope-dev got no response. I know Chris Withers thinks every object is a folderish one, but Im talking about using PropertyManager, ObjectManager and DTMLMethod all on one object. The main problem being absolute_url on the object seems to be broken.
-- Andy McKay, Developer. ActiveState.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Andy McKay wrote:
Well here's my proclamation. It cant be done...
See Toby's comment ;-) If you want to be able to do <dtml-var myFolderishThing> then you need to subclass Folder and give it a __str__ or __call__ method. I'd love to know what the difference is between these and which one you should implement in a situation like this... Any ideas anyone?
Squishdot, it seems the postings are all just stuck in one folder
Actually, it's a big IOBtree stored in the data attribute of Squishdot Site objects.
and you rewrite whole bunches of bits.
Each posting (and the site itself) has an intSet attribute called ids. This says which postings are the object's children, even though they're all stored in the same BTree.. cheers, Chris
Andy McKay wrote:
Well here's my proclamation. It cant be done...
See Toby's comment ;-)
If you want to be able to do <dtml-var myFolderishThing> then you need to subclass Folder and give it a __str__ or __call__ method. I'd love to know what the difference is between these and which one you should implement in a situation like this...
Any ideas anyone?
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.
Squishdot, it seems the postings are all just stuck in one folder
Actually, it's a big IOBtree stored in the data attribute of Squishdot Site objects.
and you rewrite whole bunches of bits.
Each posting (and the site itself) has an intSet attribute called ids. This says which postings are the object's children, even though they're all stored in the same BTree..
Oh I think I see. I'll go and have another look. I can see a product coming out of this called the DMTLFolder :) Thanks! I have to say Squishdot is one of those products whose code I keep looking at to figure out how they heck things can be done Cheers.
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__? I don't see how fiddling with __str__ would help this...
Oh I think I see. I'll go and have another look. I can see a product coming out of this called the DMTLFolder :)
Hmmm... I'd still advise against this. A normal folde with an index_html method is much more flexible and robust...
Thanks! I have to say Squishdot is one of those products whose code I keep looking at to figure out how they heck things can be done
Me too! :-) Most fo the 'funky' stuff was done by Butch before I got my grubby mits on it ;-) cheers, Chris
On Tue, 19 Sep 2000 17:19:01 -0700, "Andy McKay" <andym@ActiveState.com> wrote: Whats wrong with a folder that contains an index_html DTMLMethod?
Am I totally off my head or is it possible to make a Folderish DTML Document. I had a thread on zope-dev got no response. I know Chris Withers thinks every object is a folderish one, but Im talking about using PropertyManager, ObjectManager and DTMLMethod all on one object. The main problem being absolute_url on the object seems to be broken.
Toby Dickenson tdickenson@geminidataloggers.com
Sure it works but Im creating 2 objects a folder and a index_html for every one occurence. Im doubling my database for every object. Ugh! ----- Original Message ----- From: "Toby Dickenson" <mbel44@dial.pipex.net> To: "Andy McKay" <andym@activestate.com> Cc: <zope@zope.org> Sent: Wednesday, September 20, 2000 6:15 AM Subject: Re: [Zope] Folderish DTML Document
On Tue, 19 Sep 2000 17:19:01 -0700, "Andy McKay" <andym@ActiveState.com> wrote:
Whats wrong with a folder that contains an index_html DTMLMethod?
Am I totally off my head or is it possible to make a Folderish DTML Document. I had a thread on zope-dev got no response. I know Chris Withers thinks every object is a folderish one, but Im talking about using PropertyManager, ObjectManager and DTMLMethod all on one object. The main problem being absolute_url on the object seems to be broken.
Toby Dickenson tdickenson@geminidataloggers.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I would, I have a lot of objects. ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Andy McKay" <andym@activestate.com> Cc: <zope@zope.org> Sent: Thursday, September 21, 2000 1:52 AM Subject: Re: [Zope] Folderish DTML Document
Andy McKay wrote:
Sure it works but Im creating 2 objects a folder and a index_html for every one occurence. Im doubling my database for every object. Ugh!
I really wouldn't worry about that...
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Andy McKay wrote:
Sure it works but Im creating 2 objects a folder and a index_html for every one occurence. Im doubling my database for every object. Ugh!
I really wouldn't worry about that...
I would, I have a lot of objects.
Yes, but given you're going to end up with those two objects however your solve the problem, there's not a lot you can worry about ;-) Out of interest, what is your index_html in these folderish objects going to do? cheers, Chris
On Wed, 20 Sep 2000 09:50:16 -0700, "Andy McKay" <andym@ActiveState.com> wrote:
Sure it works but Im creating 2 objects a folder and a index_html for every one occurence. Im doubling my database for every object. Ugh!
In straight python you can only create methods for a class by creating function objects (using malloc, no less) and assigning them as variables in the class object. Double Urgh! ;-) Toby Dickenson tdickenson@geminidataloggers.com
participants (3)
-
Andy McKay -
Chris Withers -
Toby Dickenson