Fixed #679 -- 'collapse' admin row class is now processed correctly when more than one tuple is in the admin.fields list. Thanks, malcolm

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1008 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-10-25 01:47:34 +00:00
parent e0d2793b7b
commit 1ed99862c6
1 changed files with 4 additions and 4 deletions

View File

@ -556,14 +556,14 @@ def _get_template(opts, app_label, add=False, change=False, show_delete=False, f
if not seen_collapse and 'collapse' in options.get('classes', ''):
seen_collapse = True
javascript_imports.append('%sjs/admin/CollapsedFieldsets.js' % ADMIN_MEDIA_PREFIX)
try:
for field_list in options['fields']:
for field_list in options['fields']:
try:
for f in field_list:
if f.rel and isinstance(f, meta.ManyToManyField) and f.rel.filter_interface:
javascript_imports.extend(['%sjs/SelectBox.js' % ADMIN_MEDIA_PREFIX, '%sjs/SelectFilter2.js' % ADMIN_MEDIA_PREFIX])
raise StopIteration
except StopIteration:
break
except StopIteration:
break
for j in javascript_imports:
t.append('<script type="text/javascript" src="%s"></script>' % j)