Code

Opened 7 years ago

Closed 7 years ago

#4589 closed (wontfix)

[newforms-admin] Add an option to `ModelAdmin`: section_name

Reported by: yi.codeplayer at gmail dot com Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Currently, admin interface use app label to group models into sections and use app label as the section name, but i think use a admin option to specify the section name would be more flexibly (e.g. you can use non-ascii character in the option but can't do that in app label, and the models in the same app can be displayed in several sections).

I named this option as section_name currently.

If not specified, the value of section_name is the same as app_label.

I've been using this feature widely, and i hope it can be accepted.

Attachments (1)

add_section_name_option.patch (1.7 KB) - added by yi.codeplayer at gmail dot com 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by yi.codeplayer at gmail dot com

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from newforms-admin: Add an option to `ModelAdmin`: section_name to [newforms-admin] Add an option to `ModelAdmin`: section_name
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 7 years ago by Petr Marhoun <petr.marhoun@…>

I like this patch very much. I use it and I hope it will be accepted. But I think there should be capfirst and not title:

In [1]: from django.utils.text import capfirst

In [2]: capfirst('My application')
Out[2]: u'My application'

In [3]: 'My application'.title()
Out[3]: 'My Application'

In [4]: capfirst('URLconf information')
Out[4]: u'URLconf information'

In [5]: 'URLconf information'.title()
Out[5]: 'Urlconf Information'

comment:3 Changed 7 years ago by jkocherhans

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

This would require you to put section_name all over the place, and would end up in a lot of duplication. Also, I think there is a better solution for this as part of #3591. Please bring this up on django-dev if you want to plead your case.

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.