On 10/13/06, Gordon Scott <[EMAIL PROTECTED]> wrote:
An example might be

 http://someserver.com/images/600x800/watermark/file_a.png

where 600x800 and watermark are file parameters

since obviously I won't have '600x800', 'watermark', and 'file_a.png' as
resources I either need to stop processing with the 'image' resource,  or

Well, it's not *necessarily* a bad idea to make individual resources
for each of those segments. It can often make sense to make a resource
which only manages children.

However, if you do want to handle all of those parameters at once,
then override locateChild on your "images" resource. It will be passed
a context (probably soon to become a request) and segments. The
segments will be a tuple like ("600x800", "watermark", "file_a.png").
Then locateChild should "return imageResource, ()", where () means
"there should be no further processing of segments".


--
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to