Re: [pylons-discuss] Best practice of when to use view callable classes instead of functions?

2014-10-09 Thread Taylor Gronka
As they say on the CentOS forums, I'd like to update what I ended up doing 'for posterity'. The view classes are working nicely for setting up initializations which are commonly used. Probably the best example of this is that I have a master view class which the other classes inherit from. In

Re: [pylons-discuss] Best practice of when to use view callable classes instead of functions?

2014-07-13 Thread SamuraiNinja007
I really appreciate the advice and examples. I think one issue that I had was I imagine the site that I'm working on to be AJAX heavy, so it was a bit harder to imagine grouping views. I realized this while reading the responses here, and I decided to change my approach to code everything in cl

Re: [pylons-discuss] Best practice of when to use view callable classes instead of functions?

2014-07-09 Thread Jonathan Vanasco
On Tuesday, July 8, 2014 10:19:31 AM UTC-4, Paul Everitt wrote: > > 1) Visually grouping related views. Let's say you have a BlogEntry. It has > a few views. I personally like having a BlogEntryView view class to group > them together. Just an aesthetic point. > We typically use class method

Re: [pylons-discuss] Best practice of when to use view callable classes instead of functions?

2014-07-08 Thread Paul Everitt
On Jul 4, 2014, at 5:07 AM, SamuraiNinja007 wrote: > I'm mostly just looking for advice and experiences with this question. I'm > not looking for advice on my particular case; I'm just curious about when a > view callable class has created or relieved stress in the past for others. > > I'm ge

Re: [pylons-discuss] Best practice of when to use view callable classes instead of functions?

2014-07-04 Thread Michael Merickel
The best use of classes is the improve the locality of certain operations. A function-based view in Pyramid is responsible for everything it needs on its own. If it doesn't handle something on its own then it must be handled globally. A class however can make it easier to share common code between

[pylons-discuss] Best practice of when to use view callable classes instead of functions?

2014-07-04 Thread SamuraiNinja007
I'm mostly just looking for advice and experiences with this question. I'm not looking for advice on my particular case; I'm just curious about when a view callable class has created or relieved stress in the past for others. I'm getting to front-end stuff. The web-app I'm working on is quite si