Example #1
0
    def store(self, view: View, request: Request):
        # сохранение обновленого содержимого поста в бд
        post = Post.find(request.param('id'))

        post.title = request.input('title')
        post.body = request.input('body')
        post.save()

        return 'post updated'
    def store(self):
        post = Post.find(request().param('id'))

        post.title = request().input('title')
        post.body = request().input('body')

        post.save()

        return 'post updated'
Example #3
0
    def update(self, view: View, request: Request):
        post = Post.find(request.param('id'))

        post.title = request.input('title')
        post.body = request.input('body')

        post.save()

        return 'post updated'
    def show(self, view: View, request: Request):
        post = Post.find(request.param('id'))

        return view.render('blog.post.show', {
            'post': post
        })
Example #5
0
    def delete(self, request: Request):
        # удаление поста
        post = Post.find(request.param('id'))
        post.delete()

        return 'post deleted'
Example #6
0
 def update(self, view: View, request: Request):
     # обновленеи контента поста
     post = Post.find(request.param('id'))
     return view.render('update', {'post': post})
Example #7
0
 def single(self, view: View, request: Request):
     # открытие одного поста
     post = Post.find(request.param('id'))
     return view.render('single', {'post': post})
    def delete(self):
        post = Post.find(request().param('id'))
        post.delete()

        return 'post deleted'
    def update(self):
        post = Post.find(request().param('id'))

        return view('update',{'post': post})
    def single(self):
        post = Post.find(request().param('id'))

        return view('single',{'post': post})
Example #11
0
    def delete(self, request: Request):
        post = Post.find(request.param('id'))

        post.delete()

        return 'post deleted'
Example #12
0
    def edit(self, view: View, request: Request):
        post = Post.find(request.param('id'))

        return view.render('edit', {'post': post})