Accessing Dictionary Values with URL Traversal
I just had the idea that it could be possible to access the values of a dictionary with URL traversal: A object of the following class: class MyClass: myDict={ "foo": "<html> bar </html>", "dtml": DTMLFile("foo.dtml") } could be accessed like this: http://localhost:8080/myClassObject/myDict/foo --> <html> bar </html> http://localhost:8080/myClassObject/myDict/dtml --> foo.dtml Is something like this already possible? The above thing would be sometimes better than an ObjectManager, because you can have serveral dictionaries in one class. OK, you could use an ObjectManager which contains ObjectManagers, too. Nevertheless I would like to know what you think! -- Open Source Software Solutions Thomas Guettler <thomas@thomas-guettler.de> http://www.thomas-guettler.de
It's a "big" and non-intuitive idea. Can you please take a few examples of who this could be useful, and much better than the ObjectManager. I like the idea of being able to put up quick URLs for things, but can't think of a real-world example. Peter ----- Original Message ----- From: "Thomas Guettler" <guettli@thomas-guettler.de> To: <zope@zope.org> Sent: Friday, August 24, 2001 9:42 AM Subject: [Zope] Accessing Dictionary Values with URL Traversal
I just had the idea that it could be possible to access the values of a dictionary with URL traversal:
A object of the following class:
class MyClass: myDict={ "foo": "<html> bar </html>", "dtml": DTMLFile("foo.dtml") }
could be accessed like this:
http://localhost:8080/myClassObject/myDict/foo --> <html> bar </html>
http://localhost:8080/myClassObject/myDict/dtml --> foo.dtml
Is something like this already possible?
The above thing would be sometimes better than an ObjectManager, because you can have serveral dictionaries in one class. OK, you could use an ObjectManager which contains ObjectManagers, too. Nevertheless I would like to know what you think!
-- Open Source Software Solutions Thomas Guettler <thomas@thomas-guettler.de> http://www.thomas-guettler.de
_______________________________________________ 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 )
On Fri, Aug 24, 2001 at 11:05:39AM +0200, Peter Bengtsson wrote:
It's a "big" and non-intuitive idea. Can you please take a few examples of who this could be useful, and much better than the ObjectManager.
OK, I try to advertise my idea. If accessing hashes with URL-Traversal would be possible you could define several hashes. An ObjektManager can only have one collection of subclasses. class MyClass: myDict={ "foo": "<html> bar </html>", "dtml": DTMLFile("foo.dtml") } myDict2={ "foo": SomeClass(), ...} could be accessed like this: http://localhost:8080/myClassObject/myDict/foo --> <html> bar </html> http://localhost:8080/myClassObject/myDict/dtml --> foo.dtml If you want to do this with ObjektManagers you need two. First the ObjectManager containing myDict and myDict2 which need to be ObjektManagers again. You can live without it, too. But I think it worth thinking about. -- Open Source Software Solutions Thomas Guettler <thomas@thomas-guettler.de> http://www.thomas-guettler.de
Thomas Guettler writes:
I just had the idea that it could be possible to access the values of a dictionary with URL traversal: In principle, you could do that... However, ZPublisher would probably complain about missing Doc-Strings.
Dieter
participants (3)
-
Dieter Maurer -
Peter Bengtsson -
Thomas Guettler