Re: @view_config and URL dispatch

2010-12-13 Thread Ben Bangert
On Dec 12, 2010, at 10:20 PM, Jerry wrote: > but not /with/ the 'name' argument (which gives the same error as that > in my previous post) -- > > > @view_config(name='site1_view', route_name='site1', > renderer='templates/site1.pt') > > > Maybe the doc could have made it clearer that view_conf

Re: @view_config and URL dispatch

2010-12-12 Thread Jerry
Yes this works -- @view_config(route_name='site1', renderer='templates/site1.pt') but not /with/ the 'name' argument (which gives the same error as that in my previous post) -- @view_config(name='site1_view', route_name='site1', renderer='templates/site1.pt') Maybe the doc could have made i

Re: @view_config and URL dispatch

2010-12-12 Thread Eric Lemoine
On Monday, December 13, 2010, blaflamme wrote: > Yes you can, you must defin to which route name it's related: > @view_config(name='my_view', context=MyModel, permission='read', > route_name='site1') > > http://docs.pylonshq.com/pyramid/dev/api/view.html#pyramid.view.view_config Thanks. Then, I

Re: @view_config and URL dispatch

2010-12-12 Thread blaflamme
You must not define the view in your route, that should work: <__init__.py> config.add_route('site1', '/site1') config.scan() @view_config(route_name='site1', renderer='templates/site1.pt') def site1_view(request): return {'foo': 'bar'} Blaise -- You received this message because you ar

Re: @view_config and URL dispatch

2010-12-12 Thread Jerry
Hi, I'm also puzzled by the view_config()+config.scan() behavior. This works -- <__init__.py> config.add_route('site1', '/site1', view='myproject.views.site1_view', view_renderer='templates/site1.pt') while the below combination doesn't -- <__init__.py>

Re: @view_config and URL dispatch

2010-12-12 Thread blaflamme
Yes you can, you must defin to which route name it's related: @view_config(name='my_view', context=MyModel, permission='read', route_name='site1') http://docs.pylonshq.com/pyramid/dev/api/view.html#pyramid.view.view_config Blaise -- You received this message because you are subscribed to