Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#6909 closed (fixed)

Suggested import does not work with translation on

Reported by: evenrik Owned by: nobody
Component: Documentation Version: newforms-admin
Severity: Keywords: nfa-blocker
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

From http://code.djangoproject.com/wiki/NewformsAdminBranch:
A proposal convention: Specifying all admin options in a file called admin.py, and import it in the __init__.py file of your application module to do the registering during the initialization.

Adding the import there gave an error when I18N = True in my settings.py file:
AttributeError: 'module' object has no attribute '<app name>'

This seems to be the same issue as #3860 which says "It's not really a bug but a rather an undocumented quirk." I moved the import into my models.py file and the error went away.

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by Karen Tracey <kmtracey@…>

  • Keywords nfa-blocker added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This needs to be sorted out before merge, can't be recommending a convention that doesn't work for internationalization.

comment:2 Changed 6 years ago by garcia_marc

  • milestone set to 1.0 alpha

comment:3 Changed 6 years ago by programmerq

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 6 years ago by brosner

  • Resolution set to fixed
  • Status changed from new to closed

(In [7872]) newforms-admin: Added autodiscover functionality to django.contrib.admin. This makes the admin aware of per-app admin.py modules and does an import on them when explicitly called. Docs show how this is used. Fixed #6003, #6776, #6776.

Should have said #6909 in place of one #6776 ;)

comment:5 Changed 3 years ago by jacob

  • milestone 1.0 alpha deleted

Milestone 1.0 alpha deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.