4 ms·
I remember reading some OSS snippets called something like rest traversal - was that you? I know that's a bit vague - really I am asking is your hundred lines
by lifeisstillgood 14y ago
I remember reading some OSS snippets called something like rest traversal - was that you?
I know that's a bit vague - really I am asking is your hundred lines in the public domain?
- boothead 14y agoIt 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.