diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-01-20 06:32:08 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-01-20 06:32:08 +0000 |
| commit | 5b5930f0df72fbb55fc569cb523217a3b6916762 (patch) | |
| tree | 7985f559c83b53b3d1c4bbf2d86b22bafc0d2235 /django | |
| parent | 846394d2e2b41e0dd041ead98ed4832e0b0ee62a (diff) | |
newforms-admin: Renamed 'form' template variable to 'oldform' in add_view() and change_view(), in preparation for the newforms switch
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4365 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/admin/options.py | 4 | ||||
| -rw-r--r-- | django/contrib/admin/templates/admin/change_form.html | 10 | ||||
| -rw-r--r-- | django/contrib/admin/templatetags/admin_modify.py | 2 | ||||
| -rw-r--r-- | django/contrib/admin/views/main.py | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 230682fe17..773c00fb8f 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -249,7 +249,7 @@ class ModelAdmin(object): c = template.RequestContext(request, { 'title': _('Add %s') % opts.verbose_name, - 'form': form, + 'oldform': form, 'is_popup': request.REQUEST.has_key('_popup'), 'show_delete': False, }) @@ -348,7 +348,7 @@ class ModelAdmin(object): c = template.RequestContext(request, { 'title': _('Change %s') % opts.verbose_name, - 'form': form, + 'oldform': form, 'object_id': object_id, 'original': manipulator.original_object, 'is_popup': request.REQUEST.has_key('_popup'), diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index cfe2fd9998..13d862a9f7 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -34,9 +34,9 @@ <div> {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} {% if save_on_top %}{% submit_row %}{% endif %} -{% if form.error_dict %} +{% if oldform.error_dict %} <p class="errornote"> - {% blocktrans count form.error_dict.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + {% blocktrans count oldform.error_dict.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} </p> {% endif %} {% for bound_field_set in bound_field_sets %} @@ -55,9 +55,9 @@ {% if change %} {% if ordered_objects %} <fieldset class="module"><h2>{% trans "Ordering" %}</h2> - <div class="form-row{% if form.order_.errors %} error{% endif %} "> - {% if form.order_.errors %}{{ form.order_.html_error_list }}{% endif %} - <p><label for="id_order_">{% trans "Order:" %}</label> {{ form.order_ }}</p> + <div class="form-row{% if oldform.order_.errors %} error{% endif %} "> + {% if oldform.order_.errors %}{{ oldform.order_.html_error_list }}{% endif %} + <p><label for="id_order_">{% trans "Order:" %}</label> {{ oldform.order_ }}</p> </div></fieldset> {% endif %} {% endif %} diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py index fcb5876b0c..e51d458998 100644 --- a/django/contrib/admin/templatetags/admin_modify.py +++ b/django/contrib/admin/templatetags/admin_modify.py @@ -165,7 +165,7 @@ class EditInlineNode(template.Node): else: bound_related_object_class = relation.field.rel.edit_inline original = context.get('original', None) - bound_related_object = relation.bind(context['form'], original, bound_related_object_class) + bound_related_object = relation.bind(context['oldform'], original, bound_related_object_class) context['bound_related_object'] = bound_related_object t = loader.get_template(bound_related_object.template_name()) output = t.render(context) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 886999270c..ad5823f70e 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -172,7 +172,7 @@ def render_change_form(model_admin, model, manipulator, context, add=False, chan auto_populated_fields = [f for f in opts.fields if f.prepopulate_from] field_sets = model_admin.get_field_sets() original = getattr(manipulator, 'original_object', None) - bound_field_sets = [field_set.bind(context['form'], original, AdminBoundFieldSet) for field_set in field_sets] + bound_field_sets = [field_set.bind(context['oldform'], original, AdminBoundFieldSet) for field_set in field_sets] first_form_field_id = bound_field_sets[0].bound_field_lines[0].bound_fields[0].form_fields[0].get_id(); ordered_objects = opts.get_ordered_objects() inline_related_objects = opts.get_followed_related_objects(manipulator.follow) |
