Hi, good question, one that commonly comes up. First, I think below you mean “route” where you say “root”. I believe your question is: why does Pyramid make you define both a route and a view, and do so separately?
The tutorial section on routes explains this: http://docs.pylonsproject.org/projects/pyramid/en/latest/quick_tutorial/routing.html <http://docs.pylonsproject.org/projects/pyramid/en/latest/quick_tutorial/routing.html> Look for the blue-background section near the top. In a nutshell: - If they were combined, you couldn’t control the route definition order across multiple files and packages - It is common in Pyramid for one route/URL to work for multiple views (one for GET, one for POST, one for JSON rendering, etc.) —Paul > On Nov 11, 2015, at 6:23 AM, kk <[email protected]> wrote: > > Dear all, > I am new to Pyramid and I am actually surprised and confused with the two > terms mentioned in the subject. > My understanding was that any framework would have a rooting mechanism where > we just have the root pattern and associate the view callable to it. > But here I see that not just the rooting has to be there, but just before the > view function we need > > @view_config(route_name=vew_name) I am not understanding if this is optional > or is it compulsary. I am further confused if the roots match the url pattern > with the view or with any thing that is associated with the line about the > view. Can some one clear it out to me? I have gone through all possible > documentation I could find, right from the introduction tutorials/ But it is > getting more and more confusing. Happy hacking. Krishnakant. > > -- > 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. -- 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.
