take care of next

This commit is contained in:
Gael Pasgrimaud
2011-04-16 15:10:26 +02:00
parent 34e0766c44
commit f9bddff98c
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -92,6 +92,7 @@ def formalchemy_admin(config, route_name,
**kw)
config.add_view(context='pyramid_formalchemy.resources.Model',
renderer='json',
name='',
attr='update',
request_method='POST',
permission='edit',
+3 -1
View File
@@ -12,6 +12,7 @@ from pyramid.response import Response
from pyramid import httpexceptions as exc
from pyramid.exceptions import NotFound
from pyramid_formalchemy.utils import TemplateEngine
import logging
try:
from formalchemy.ext.couchdb import Document
@@ -338,8 +339,9 @@ class ModelView(object):
if request.is_xhr:
response.content_type = 'text/plain'
return ''
next = request.POST.get('next') or request.fa_url(request.model_name)
return exc.HTTPFound(
location=request.fa_url(request.model_name))
location=next)
else:
fs.rebind(fs.model, data=None)
return self.render(fs=fs)