mirror of
https://github.com/wassname/pyramid_formalchemy.git
synced 2026-07-14 01:10:14 +08:00
take care of next
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user