예제 #1
0
파일: views.py 프로젝트: gmist/five-studio
def add_manager(request):
    form = ManagerForm()
    if request.method == 'POST':
        if request.form and form.validate(request.form):
            manager = form.save()
            manager.put()
            return redirect(url_for('admin/managers'))
    return render_to_response('admin/add_manager.html', {'form':form.as_widget()})
예제 #2
0
파일: views.py 프로젝트: gmist/five-studio
def edit_manager(request, key):
    manager = Manager.get(key)
    form = ManagerForm(manager)
    if request.method == 'POST':
        if request.form and form.validate(request.form):
            manager = form.save()
            manager.put()
            return redirect(url_for('admin/managers'))
    photo_form = ManagerPhoto()
    return render_to_response('admin/edit_manager.html', {'manager':manager, 'form':form.as_widget(), 'photo_form':photo_form.as_widget()})