tag:blogger.com,1999:blog-18508356.post113423681175313702..comments2023-05-21T09:53:50.042-04:00Comments on Just a little Python: Hierarchical CherryPyRick Copelandhttp://www.blogger.com/profile/11612114223288841087noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-18508356.post-1143745657629182412006-03-30T14:07:00.000-05:002006-03-30T14:07:00.000-05:00I've written a decorator that does this:http://doc...I've written a decorator that does this:<BR/>http://docs.cherrypy.org/quixoteAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-18508356.post-1134400794431371222005-12-12T10:19:00.000-05:002005-12-12T10:19:00.000-05:00robert, thanks for the comment. The reason I can'...robert, thanks for the comment. The reason I can't use default is that I want to have CherryPy continue traversal after the "programmable" part of my path (the <customer id> in the example above). default(), on the other hand, insists on being the <EM>last</EM> thing on the path. (It handles the rest of the path as positional arguments.) If there was a mechanism to do this, you could basically have nice, dynamic paths. I guess it's kind of Zope-ish. But maybe that's not so bad.<BR/><BR/>I'd <EM>like</EM> to do the "Right" thing in CherryPy, I'm pretty sure overriding __getattr__ is <EM>not</EM> the Right thing, but I can't figure out a blessed way to do it. Of course, this is just a "wart," in my opinion. Not enough to make me switch to something else.Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.comtag:blogger.com,1999:blog-18508356.post-1134262625961659012005-12-10T19:57:00.000-05:002005-12-10T19:57:00.000-05:00I tend to use CherryPy's default method and just h...I tend to use CherryPy's default method and just handle the rest of the dispatching manually.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-18508356.post-1134240058689163652005-12-10T13:40:00.000-05:002005-12-10T13:40:00.000-05:00Well, I did at least find the way Quixote does thi...Well, I did at least find the way Quixote does this: by using the _q_lookup() method. It's covered in <A HREF="http://quixote.ca/learn/1" REL="nofollow">Quixote tutorial 1</A>.Rick Copelandhttps://www.blogger.com/profile/11612114223288841087noreply@blogger.com