# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from blog.blog_model import Blog, BlogForm
from config.template_middleware import TemplateResponse
from routes import blogs
from tekton.gae.middleware.redirect import RedirectResponse
from gaepermission.decorator import login_not_required

@login_not_required
def salvar(**kwargs):
    form =  BlogForm(**kwargs)
    erros=form.validate()
    if not erros:
        propriedades=form.normalize()
        blog = Blog(**propriedades)
        blog.put()
        return RedirectResponse(blogs)
    else:
        ctx = {'blog': kwargs, 'erros':erros}
        return TemplateResponse(ctx, 'blogs/blogs_form.html')
f94e4330d602926a64982d817293c79ac4269a6e
<mask token>

<mask token>


@login_not_required
def salvar(**kwargs):
    form = BlogForm(**kwargs)
    erros = form.validate()
    if not erros:
        propriedades = form.normalize()
        blog = Blog(**propriedades)
        blog.put()
        return RedirectResponse(blogs)
    else:
        ctx = {'blog': kwargs, 'erros': erros}
        return TemplateResponse(ctx, 'blogs/blogs_form.html')

from __future__ import absolute_import, unicode_literals
from blog.blog_model import Blog, BlogForm
from config.template_middleware import TemplateResponse
from routes import blogs
from tekton.gae.middleware.redirect import RedirectResponse
from gaepermission.decorator import login_not_required


@login_not_required
def salvar(**kwargs):
    form = BlogForm(**kwargs)
    erros = form.validate()
    if not erros:
        propriedades = form.normalize()
        blog = Blog(**propriedades)
        blog.put()
        return RedirectResponse(blogs)
    else:
        ctx = {'blog': kwargs, 'erros': erros}
        return TemplateResponse(ctx, 'blogs/blogs_form.html')

# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from blog.blog_model import Blog, BlogForm
from config.template_middleware import TemplateResponse
from routes import blogs
from tekton.gae.middleware.redirect import RedirectResponse
from gaepermission.decorator import login_not_required

@login_not_required
def salvar(**kwargs):
    form =  BlogForm(**kwargs)
    erros=form.validate()
    if not erros:
        propriedades=form.normalize()
        blog = Blog(**propriedades)
        blog.put()
        return RedirectResponse(blogs)
    else:
        ctx = {'blog': kwargs, 'erros':erros}
        return TemplateResponse(ctx, 'blogs/blogs_form.html')