ugettext() in app `__init__.py` causes error.
|Reported by:||julien||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)
Changed 7 years ago by julien
comment:1 Changed 7 years ago by brosner
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to invalid
- Status changed from new to closed
comment:2 Changed 7 years ago by mtredinnick
- Component changed from Uncategorized to Internationalization
- Resolution invalid deleted
- Status changed from closed to reopened
- Triage Stage changed from Unreviewed to Accepted
comment:3 Changed 7 years ago by mtredinnick
- Summary changed from Strange import problem since upgrading to newforms-admin to ugettext() in app `__init__.py` causes error.