If each of your views is mapped to a separate template file I would consider registering each route imperatively. That way, you can still utilize the application's template configuration. If that's not an option, I think #3 would be your next best bet; it seems like the DRYest of 1-3.
On Mon, Sep 14, 2015 at 10:43 AM, Jonathan Vanasco <[email protected]> wrote: > I'm doing a code-review/integration on some very standardized routes, and > wondering if anyone has looked into this issue before. > > the PR has about 150+ routes that currently has little-to-no logic, and > are basically just a URL mapped to a mako file. > > we use class-based views, so it looks like: > > class Foo(handler): > @viewconfig(route="section:a", renderer="section/a.mako"): > def a(self): > return {'project': 'App'} > > @viewconfig(route="section:b", renderer="section/b.mako"): > def b(self): > return {'project': 'App'} > > @viewconfig(route="section:b:a", renderer="section/b/a.mako"): > def b_a(self): > return {'project': 'App'} > > > I'm wondering what the best way to proceed is: > > 1. leave as-is > 2. collapse all the @viewconfigs onto a single def > 3. write a catchall route for everything in /section, use a single def to > handle the logic or raise a 404 > 4. something else > i have a feeling that #3 might be the best in terms of performance, but I > haven't tested anything (and am hoping someone else has and can share! ) > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/d/optout. > -- Vincent Catalano Software Engineer and Web Developer, (520).603.8944 -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.
