On Feb 1, 2006, at 11:07 AM, Phillip J. Eby wrote: >> spec is about (like what is template polymorphism exactly ?) > > Specifying only a template's *name* in code, not its type. In > peak.web, if I refer to a resource or template named "foo", the > system looks in the resource directory and determines the template > type based on extensions. So if there's a foo.pwt or foo.html or > foo.gif or foo.jpeg, it determines the resource type from that. > When you combine this feature with skinning, it means that > deployers are free to change the technology used to deliver a > particular template or resource. For example, replacing a .gif > or .jpeg with a .png or vice versa, or using a different template > engine for a template. >
It seems like myghty resolver does this as well...you send in a URI, and as it walks down the chain, it can hit FileResolver (returns file- based templates), ModuleResolver (returns python callables), each of which are free to return whatever Component object they want if they have something to offer for that URI; each Component just has a run() method. you can inject whatever customized rule you want to return something else at some point. rules could be constructed to return an adapted version of any other template's template object too. _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com