Author: jkocherhans
Date: 2007-09-11 22:13:30 -0500 (Tue, 11 Sep 2007)
New Revision: 6107
Modified:
django/branches/newforms-admin/django/contrib/admin/options.py
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_stacked.html
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_tabular.html
Log:
newforms-admin: Changed inline model admin back to using
verbose_name/verbose_name_plural. We may need both in the templates.
Modified: django/branches/newforms-admin/django/contrib/admin/options.py
===================================================================
--- django/branches/newforms-admin/django/contrib/admin/options.py
2007-09-12 02:44:27 UTC (rev 6106)
+++ django/branches/newforms-admin/django/contrib/admin/options.py
2007-09-12 03:13:30 UTC (rev 6107)
@@ -687,13 +687,18 @@
fk_name = None
extra = 3
template = None
- label = None
+ verbose_name = None
+ verbose_name_plural = None
def __init__(self, parent_model, admin_site):
self.admin_site = admin_site
self.parent_model = parent_model
self.opts = self.model._meta
super(InlineModelAdmin, self).__init__()
+ if self.verbose_name is None:
+ self.verbose_name = self.model._meta.verbose_name
+ if self.verbose_name_plural is None:
+ self.verbose_name_plural = self.model._meta.verbose_name_plural
def formset_add(self, request):
"""Returns an InlineFormSet class for use in admin add views."""
@@ -726,15 +731,9 @@
class StackedInline(InlineModelAdmin):
template = 'admin/edit_inline_stacked.html'
- def get_label(self):
- return self.label or self.model._meta.verbose_name
-
class TabularInline(InlineModelAdmin):
template = 'admin/edit_inline_tabular.html'
- def get_label(self):
- return self.label or self.model._meta.verbose_name_plural
-
class InlineAdminFormSet(object):
"""
A wrapper around an inline formset for use in the admin system.
Modified:
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_stacked.html
===================================================================
---
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_stacked.html
2007-09-12 02:44:27 UTC (rev 6106)
+++
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_stacked.html
2007-09-12 03:13:30 UTC (rev 6107)
@@ -1,7 +1,7 @@
{{ inline_admin_formset.formset.management_form }}
{% for inline_admin_form in inline_admin_formset %}
<fieldset class="module aligned {{ bfset.fieldset.classes }}">
- <h2>{{ inline_admin_formset.opts.get_label|title }} #{{ forloop.counter
}}</h2>
+ <h2>{{ inline_admin_formset.opts.verbose_name|title }} #{{
forloop.counter }}</h2>
{% for bfset in inline_admin_form %}
<!-- fieldsets, headers, and descriptions are commented out until we have
decent styles for them -->
<!--<fieldset>-->
Modified:
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_tabular.html
===================================================================
---
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_tabular.html
2007-09-12 02:44:27 UTC (rev 6106)
+++
django/branches/newforms-admin/django/contrib/admin/templates/admin/edit_inline_tabular.html
2007-09-12 03:13:30 UTC (rev 6107)
@@ -1,7 +1,7 @@
{% load i18n %}
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module">
- <h2>{{ inline_admin_formset.opts.get_label|capfirst|escape }}</h2>
+ <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst|escape }}</h2>
<table>
<thead><tr>
{% if inline_admin_formset.formset.deletable %}<th>{% trans "Delete"
%}?</th>{% endif %}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---