Django

Code

Ticket #4058 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

Databrowse AttributeError with USE_I18N=True

Reported by: anonymous Assigned to: adrian
Milestone: Component: Contrib apps
Version: SVN Keywords: databrowse
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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

Attachments

Change History

04/16/07 17:29:30 changed by Nathan Borror <nathan@playgroundblues.com>

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

Submitted by me :)

04/16/07 18:47:29 changed by adrian

Hmm, it works fine for me...

Could you paste the full traceback, please?

04/16/07 19:10:55 changed by anonymous

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'

04/16/07 19:33:14 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Accepted.

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)

04/16/07 19:35:15 changed by adrian

  • summary changed from Databrowse AttributeError to Databrowse 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.

04/16/07 19:40:11 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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

04/16/07 20:08:29 changed by bin

Great response time Adrian!

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

Thanks.

04/17/07 01:41:31 changed by adrian

Yes, this is the one. :)


Add/Change #4058 (Databrowse AttributeError with USE_I18N=True)




Change Properties
Action