Author: adrian
Date: 2007-01-20 00:32:08 -0600 (Sat, 20 Jan 2007)
New Revision: 4365

Modified:
   django/branches/newforms-admin/django/contrib/admin/options.py
   
django/branches/newforms-admin/django/contrib/admin/templates/admin/change_form.html
   
django/branches/newforms-admin/django/contrib/admin/templatetags/admin_modify.py
   django/branches/newforms-admin/django/contrib/admin/views/main.py
Log:
newforms-admin: Renamed 'form' template variable to 'oldform' in add_view() and 
change_view(), in preparation for the newforms switch

Modified: django/branches/newforms-admin/django/contrib/admin/options.py
===================================================================
--- django/branches/newforms-admin/django/contrib/admin/options.py      
2007-01-20 06:25:13 UTC (rev 4364)
+++ django/branches/newforms-admin/django/contrib/admin/options.py      
2007-01-20 06:32:08 UTC (rev 4365)
@@ -249,7 +249,7 @@
 
         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 @@
 
         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'),

Modified: 
django/branches/newforms-admin/django/contrib/admin/templates/admin/change_form.html
===================================================================
--- 
django/branches/newforms-admin/django/contrib/admin/templates/admin/change_form.html
        2007-01-20 06:25:13 UTC (rev 4364)
+++ 
django/branches/newforms-admin/django/contrib/admin/templates/admin/change_form.html
        2007-01-20 06:32:08 UTC (rev 4365)
@@ -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 %}

Modified: 
django/branches/newforms-admin/django/contrib/admin/templatetags/admin_modify.py
===================================================================
--- 
django/branches/newforms-admin/django/contrib/admin/templatetags/admin_modify.py
    2007-01-20 06:25:13 UTC (rev 4364)
+++ 
django/branches/newforms-admin/django/contrib/admin/templatetags/admin_modify.py
    2007-01-20 06:32:08 UTC (rev 4365)
@@ -165,7 +165,7 @@
         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)

Modified: django/branches/newforms-admin/django/contrib/admin/views/main.py
===================================================================
--- django/branches/newforms-admin/django/contrib/admin/views/main.py   
2007-01-20 06:25:13 UTC (rev 4364)
+++ django/branches/newforms-admin/django/contrib/admin/views/main.py   
2007-01-20 06:32:08 UTC (rev 4365)
@@ -172,7 +172,7 @@
     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)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to