mirror of
https://github.com/django/django.git
synced 2025-06-29 15:29:13 +00:00
magic-removal: Removed support for '_preview' in admin POST data. This idea was never fully realized.
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2071 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a1b6457313
commit
cf0406d5ea
@ -204,6 +204,7 @@ def add_stage(request, app_label, model_name, show_delete=False, form_url='', po
|
|||||||
manipulator = model.AddManipulator()
|
manipulator = model.AddManipulator()
|
||||||
if request.POST:
|
if request.POST:
|
||||||
new_data = request.POST.copy()
|
new_data = request.POST.copy()
|
||||||
|
|
||||||
if opts.has_field_type(models.FileField):
|
if opts.has_field_type(models.FileField):
|
||||||
new_data.update(request.FILES)
|
new_data.update(request.FILES)
|
||||||
|
|
||||||
@ -216,9 +217,7 @@ def add_stage(request, app_label, model_name, show_delete=False, form_url='', po
|
|||||||
#get the errors on the updated shape of the manipulator
|
#get the errors on the updated shape of the manipulator
|
||||||
#HACK - validators should not work on POSTED data directly...
|
#HACK - validators should not work on POSTED data directly...
|
||||||
errors = manipulator.get_validation_errors(data)
|
errors = manipulator.get_validation_errors(data)
|
||||||
if request.POST.has_key("_preview"):
|
if request.POST.has_key("command"):
|
||||||
pass
|
|
||||||
elif request.POST.has_key("command"):
|
|
||||||
command_name = request.POST.get("command")
|
command_name = request.POST.get("command")
|
||||||
manipulator.do_command(command_name)
|
manipulator.do_command(command_name)
|
||||||
new_data = manipulator.flatten_data()
|
new_data = manipulator.flatten_data()
|
||||||
@ -296,9 +295,7 @@ def change_stage(request, app_label, model_name, object_id):
|
|||||||
#get the errors on the updated shape of the manipulator
|
#get the errors on the updated shape of the manipulator
|
||||||
#HACK - validators should not work on POSTED data directly...
|
#HACK - validators should not work on POSTED data directly...
|
||||||
|
|
||||||
if request.POST.has_key("_preview"):
|
if request.POST.has_key("command"):
|
||||||
errors = manipulator.get_validation_errors(data)
|
|
||||||
elif request.POST.has_key("command"):
|
|
||||||
command_name = request.POST.get("command")
|
command_name = request.POST.get("command")
|
||||||
manipulator.do_command(command_name)
|
manipulator.do_command(command_name)
|
||||||
errors = manipulator.get_validation_errors(data)
|
errors = manipulator.get_validation_errors(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user