Nested adaptation using Pyramid's registry

2012-03-01 Thread Jonathan Ballet
Hello, I have some code which looks like this: @adapter(IFolder) @implementer(IImage) def thumbnail_of_folder(folder): return IImage(folder[0]) I want this to adapt and recurse into the subfolders until it founds an IImage (the example assumes there's always something into

Re: Nested adaptation using Pyramid's registry

2012-03-01 Thread Chris McDonough
On Thu, 2012-03-01 at 20:26 +0700, Jonathan Ballet wrote: Hello, I have some code which looks like this: @adapter(IFolder) @implementer(IImage) def thumbnail_of_folder(folder): return IImage(folder[0]) I want this to adapt and recurse into the subfolders until it

Re: Nested adaptation using Pyramid's registry

2012-03-01 Thread Jonathan Ballet
On Thu, Mar 01, 2012 at 10:29:29AM -0500, Chris McDonough wrote: On Thu, 2012-03-01 at 20:26 +0700, Jonathan Ballet wrote: Hello, I have some code which looks like this: @adapter(IFolder) @implementer(IImage) def thumbnail_of_folder(folder): return

Re: Nested adaptation using Pyramid's registry

2012-03-01 Thread Chris McDonough
On Thu, 2012-03-01 at 22:36 +0700, Jonathan Ballet wrote: On Thu, Mar 01, 2012 at 10:29:29AM -0500, Chris McDonough wrote: On Thu, 2012-03-01 at 20:26 +0700, Jonathan Ballet wrote: Hello, I have some code which looks like this: @adapter(IFolder) @implementer(IImage)

Re: Nested adaptation using Pyramid's registry

2012-03-01 Thread Jonathan Ballet
On Thu, Mar 01, 2012 at 10:48:02AM -0500, Chris McDonough wrote: Yes, I read the document you mentioned, but I actually want to know if there is a way and how to do *without* using the global registry or accessing the thread-local registry. No, there's no declarative way to spell ascend

Re: Nested adaptation using Pyramid's registry

2012-03-01 Thread Chris McDonough
On Thu, 2012-03-01 at 23:03 +0700, Jonathan Ballet wrote: On Thu, Mar 01, 2012 at 10:48:02AM -0500, Chris McDonough wrote: Yes, I read the document you mentioned, but I actually want to know if there is a way and how to do *without* using the global registry or accessing the