3 ms·
It turned out to be a bit more than 100 lines when I added it all up :-) Here's the bulk of the code in a gist, with a little example of usage: https://gist.g
by boothead 14y ago
It turned out to be a bit more than 100 lines when I added it all up :-)
Here's the bulk of the code in a gist, with a little example of usage:
https://gist.github.com/boothead/5108455 https://gist.github.com/boothead/5108455
Be happy to answer any questions if it's unclear.
The great thing about pyramid that this code might not really indicate if you're not familiar with it, is that you can attach instances of these traversal classes anywhere in your tree and the views will still do the right thing. Likewise, using the model_is predicate lets you override the default json renderer for specific classes if you need to.