Hi,

i am rather new to Pyramid(v1.3b1) in general.
i basically want to redirect to the same page you are on, just want to 
execute some code on the server side and then show 
the refreshed version of the page you are on.

So far in my project.py i added the routing:

    config.add_route('normalView', '/view/{id}')
>     config.add_route('updatedView', '/view/{id}') 


 as well as the callbacks:

for the normal view:

> @view_config(route_name='normalView', renderer='view.mako')
> def normal_view(request):
>    check_for_updates()

   view = dict(title='View Page',

                id=some_id,

                name=some_name,

                pics=some_pic_count,

                url=_static_pic_urls)

    return view


for the updated view, i just execute the code and show the normal view 
again which itself checks for the updates

@view_config(route_name='updatedView', renderer='view.mako')
> def update_view(request):
>     print "do some stuff and refresh"    
>     return normal_view(request);


my problem is in my view.mako file:

<h1>View: ${name}</h1>
> <a href="${request.route_url('updateView', id='${id}')}">Execute Code and 
> Update this site</a> ## this link will refer to host:8080/view/%24%7Bid%7D
>
without the 'Apostrophe' 

> <a href="${request.route_url('updateView', id=${id})}">Execute Code and 
> Update this site</a> ## this will not render because of a SyntaxException

but when i hard code an id='2' this will actually work 

> <a href="${request.route_url('updateView', id='2')}">Execute Code and 
> Update this site</a> ## this will work but is static :(
>

Any help is appreciated. 

-- 
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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to