I think we answered this on IRC already but I think it had to do with
having 2 views with the same function name in the same module. Just in case
anyone else was planning to try to answer this.

On Mon, Dec 19, 2011 at 7:06 PM, Travis Jensen <travis.jen...@gmail.com>wrote:

> Banging my head against a wall here. I've added a new view to my
> project. Other views in the project are working fine, but this new
> view isn't. So here is the view not working:
>
> (in __init__.py):
>    config.add_route('blog_home', '/blogs/home')
>
> (in views/blogviews.py):
>    @view_config(route_name='blog_home', context='..resources.Root',
>             renderer="clicklock:templates/blog-home.mako")
>    @core_attributes(section='blog', section_home=True)
>    def blog_home_view(request):
>        print "start da blog home"
>        ....
>
> Note: I have validate blogviews.py is being loaded. @core_attributes
> set some template variables that all templates are using, and it is
> fine in other places.
>
> Here is a sample view that is working fine:
>
> (in __init__.py):
>    config.add_route('home', '/')
>
> (in publicsite.py):
>    @view_config(route_name='home', context='..resources.Root',
>             renderer="clicklock:templates/home.mako")
>    @core_attributes(section_home=True)
>    def home_view(request):
>        return {}
>
> The error I'm seeing when I make a request:
>
> > curl http://zero.local:6543/blogs/home
>
> 2011-12-19 18:04:47,917 DEBUG [clicklock][worker 2] route matched for
> url http://zero.local:6543/blogs/home; route_name: 'blog_home',
> path_info: '/blogs/home', pattern: '/blogs/home', matchdict: {},
> predicates: ''
> 2011-12-19 18:04:47,917 DEBUG [clicklock][worker 2] debug_notfound of
> url http://zero.local:6543/blogs/home; path_info: '/blogs/home',
> context: <clicklock.resources.Root object at 0x101be9b90>, view_name:
> u'', subpath: (), traversed: (), root: <clicklock.resources.Root
> object at 0x101be9b90>, vroot: <clicklock.resources.Root object at
> 0x101be9b90>, vroot_path: ()
>
> If I'm reading this correctly, it finds the route in the config
> object, but fails to find the actual view. Any ideas why?
>
> Thanks.
>
> tj
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to