On 03/04/2015 11:03 AM, Jonathan Vanasco wrote:


On Wednesday, March 4, 2015 at 10:30:44 AM UTC-5, Oliver Berger wrote:

    If you want the same view executed for several urls just decorate it
    twice with a different route...


+1

That's what most people would do.

it would look something like this:

     config.add_route ('test_index', '/ test /')
     config.add_route ('test_focus', '/ test / {test_id}')

      class MyViews(object):
         @view_config("test_index")
         @view_config("test_focus")
         def test_unified(self):
              pass


To be pedantic...

       class MyViews(object):
          @view_config(route_name="test_index")
          @view_config(route_name="test_focus")
          def test_unified(self):
               pass

(requires 'route_name=' keyword arg to work properly).

- C






--
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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[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.

Reply via email to