ugettext() in app `__init__.py` causes error.
|Reported by:||Julien Phalip||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
*Please note*: I know this may look like it belongs to the user mailing list, but in  we thought Trac would be a better place for it.
I'm having a strange import issue since I have upgraded my project to NFA. To illustrate the issue I've attached a ZIP with very simple code.
Basically, the project won't run (that is, when the server is restarted and tries to launch Django). I get the error: "ImportError: cannot import name MenuItem".
Now, what is very strange here, is that I can get rid of the error in two different ways:
1) Either by swapping the order of the apps in INSTALLED_APPS:
INSTALLED_APPS = ( 'menu', 'menu_extension', )
INSTALLED_APPS = ( 'menu_extension', 'menu', )
2) Or by Removing the ugettext call in menu.models:
caption = models.CharField(_('Caption'), max_length=50)
caption = models.CharField('Caption', max_length=50)
Weird! Does that example uncover a bug in Django or rather my misuse of Python and/or NFA?
I'm using newforms-admin-SVN-7871.
Change History (6)
comment:1 Changed 8 years ago by
|Patch needs improvement:||unset|
|Status:||new → closed|
comment:2 Changed 8 years ago by
|Component:||Uncategorized → Internationalization|
|Status:||closed → reopened|
|Triage Stage:||Unreviewed → Accepted|
comment:3 Changed 8 years ago by
|Summary:||Strange import problem since upgrading to newforms-admin → ugettext() in app `__init__.py` causes error.|