Esempio n. 1
0
def posts_create():
    print dir(request.POST)
    post = Post()
    post.build(request.POST)

    try:
        post.validate()
        post.save()
        redirect('/')
    except mongoengine.ValidationError, e:
        return New(post, e).render()
Esempio n. 2
0
def posts_create():
    print dir(request.POST)
    post = Post()
    post.build(request.POST)

    try:
        post.validate()
        post.save()
        redirect('/')
    except mongoengine.ValidationError, e:
        return New(post, e).render()