From 968a0627d94ea425eda4d053871fcfe8aef14f26 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 17 Apr 2007 00:40:11 +0000 Subject: [PATCH] Fixed #4058 -- Fixed AttributeError in databrowse with USE_I18N=True git-svn-id: http://code.djangoproject.com/svn/django/trunk@5015 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/databrowse/datastructures.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/contrib/databrowse/datastructures.py b/django/contrib/databrowse/datastructures.py index 3c509a2830..346a1e95e0 100644 --- a/django/contrib/databrowse/datastructures.py +++ b/django/contrib/databrowse/datastructures.py @@ -3,7 +3,6 @@ These classes are light wrappers around Django's database API that provide convenience functionality and permalink functions for the databrowse app. """ -from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE from django.db import models from django.utils import dateformat from django.utils.text import capfirst @@ -132,6 +131,10 @@ class EasyInstanceField(object): Returns a list of values for this field for this instance. It's a list so we can accomodate many-to-many fields. """ + # This import is deliberately inside the function because it causes + # some settings to be imported, and we don't want to do that at the + # module level. + from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE if self.field.rel: if isinstance(self.field.rel, models.ManyToOneRel): objs = getattr(self.instance.instance, self.field.name)