| 86 | | (insert example) |
| | 86 | {{{ |
| | 87 | def style_edit_inline(request, object_id): |
| | 88 | try: |
| | 89 | follow = { |
| | 90 | 'choices' : True, |
| | 91 | } |
| | 92 | manipulator = styles.ChangeManipulator(object_id, follow) <------ EXTRA ARGUMENT |
| | 93 | except ObjectDoesNotExist: |
| | 94 | raise Http404 |
| | 95 | |
| | 96 | if request.POST: |
| | 97 | new_data = request.POST.copy() |
| | 98 | |
| | 99 | errors = manipulator.get_validation_errors(new_data) |
| | 100 | |
| | 101 | manipulator.do_html2python(new_data) |
| | 102 | if not errors: |
| | 103 | manipulator.save(new_data) |
| | 104 | return HttpResponseRedirect("") |
| | 105 | else: |
| | 106 | # Populate new_data with a "flattened" version of the current data. |
| | 107 | new_data = manipulator.flatten_data() |
| | 108 | errors = {} |
| | 109 | |
| | 110 | |
| | 111 | # Populate the FormWrapper. |
| | 112 | form = formfields.FormWrapper(manipulator, new_data, errors, edit_inline = True) # ,----- EXTRA ARGUMENT |
| | 113 | |
| | 114 | |
| | 115 | return render_to_response('style_edit_inline', { 'form': form }) |
| | 116 | |
| | 117 | }}} |