Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4058 closed (fixed)

Databrowse AttributeError with USE_I18N=True

Reported by: anonymous Owned by: Adrian Holovaty
Component: Contrib apps Version: dev
Severity: Keywords: databrowse
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Getting the error: "AttributeError: 'module' object has no attribute 'databrowse'" upon adding 'django.contrib.databrowse' to INSTALLED_APPS.

Change History (8)

comment:1 by Nathan Borror <nathan@…>, 17 years ago

Submitted by me :)

comment:2 by Adrian Holovaty, 17 years ago

Hmm, it works fine for me...

Could you paste the full traceback, please?

comment:3 by anonymous, 17 years ago

Traceback (most recent call last):
  File "./manage.py", line 11, in ?
    execute_manager(settings)
  File "/home/alex/source/svn/django/django/core/management.py", line 1669, in execute_manager
    execute_from_command_line(action_mapping, argv)
  File "/home/alex/source/svn/django/django/core/management.py", line 1561, in execute_from_command_line
    translation.activate('en-us')
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 66, in activate
    return real_activate(language)
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 41, in delayed_loader
    return g[caller](*args, **kwargs)
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 66, in activate
    return real_activate(language)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 194, in activate
    _active[currentThread()] = translation(language)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 183, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 166, in _fetch
    app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), appname[p+1:])
  File "/home/alex/source/svn/django/django/contrib/databrowse/__init__.py", line 1, in ?
    from django.contrib.databrowse.sites import DatabrowsePlugin, ModelDatabrowse, DatabrowseSite, site
  File "/home/alex/source/svn/django/django/contrib/databrowse/sites.py", line 3, in ?
    from django.contrib.databrowse.datastructures import EasyModel, EasyChoice
  File "/home/alex/source/svn/django/django/contrib/databrowse/datastructures.py", line 6, in ?
    from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE
  File "/home/alex/source/svn/django/django/contrib/admin/views/main.py", line 4, in ?
    from django.contrib.admin.views.decorators import staff_member_required
  File "/home/alex/source/svn/django/django/contrib/admin/views/decorators.py", line 3, in ?
    from django.contrib.auth.models import User
  File "/home/alex/source/svn/django/django/contrib/auth/models.py", line 4, in ?
    from django.contrib.contenttypes.models import ContentType
  File "/home/alex/source/svn/django/django/contrib/contenttypes/models.py", line 33, in ?
    class ContentType(models.Model):
  File "/home/alex/source/svn/django/django/db/models/base.py", line 35, in __new__
    new_class.add_to_class('_meta', Options(attrs.pop('Meta', None)))
  File "/home/alex/source/svn/django/django/db/models/base.py", line 174, in add_to_class
    value.contribute_to_class(cls, name)
  File "/home/alex/source/svn/django/django/db/models/options.py", line 53, in contribute_to_class
    setattr(self, 'verbose_name_plural', meta_attrs.pop('verbose_name_plural', self.verbose_name + 's'))
  File "/home/alex/source/svn/django/django/utils/functional.py", line 42, in __wrapper__
    res = self.__func(*self.__args, **self.__kw)
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 52, in gettext
    return real_gettext(message)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 254, in gettext
    _default = translation(settings.LANGUAGE_CODE)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 183, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 166, in _fetch
    app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), appname[p+1:])
AttributeError: 'module' object has no attribute 'databrowse'

comment:4 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedAccepted

I get exactly the same traceback in trans_real when it trys to parse the models.py

(#4059 looks to be a duplicate of this too)

comment:5 by Adrian Holovaty, 17 years ago

Summary: Databrowse AttributeErrorDatabrowse AttributeError with USE_I18N=True

I've verified that the problem happens when USE_I18N=True. It doesn't happen for me if USE_I18N=False.

comment:6 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

(In [5015]) Fixed #4058 -- Fixed AttributeError in databrowse with USE_I18N=True

comment:7 by bin, 17 years ago

Great response time Adrian!

So this is the contrib you have hinted at in the past? I'm very curious.

Thanks.

comment:8 by Adrian Holovaty, 17 years ago

Yes, this is the one. :)

Note: See TracTickets for help on using tickets.
Back to Top