Pylons / pyramid_blogr

Pyramid_blogr is an example implementation of Flaskr app with Pyramid Web Framework
72 stars 39 forks source link

Yes,it should work #58

Closed morrismuturi closed 7 years ago

morrismuturi commented 7 years ago
@view_config(route_name='blog_action', match_param="action=delete", permission='delete')
def blog_delete(request):
    blog_id = int(request.params.get('id', -1))
    entry = BlogRecordService.by_id(blog_id,request)
    if not entry:
        return HTTPNotFound()
    request.dbsession.delete(entry)
    return HTTPFound(location=request.route_url('home'))

<a href="{{ request.route_url('blog_action', action='delete',
        _query={'id':entry.id}) }}">Delete Entry</a>
ergo commented 7 years ago

Hi @morrismuturi, Can you shed some more light on this issue?

digitalresistor commented 7 years ago

(Fixed up formatting)