Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#10705 closed (wontfix)

Admin_list.py - Items_for_result() hardcoding field type formating is ugly

Reported by: Joshua Russo Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The logic for setting the result_repr value (in django\contrib\admin\templatetags\admin_list.py) should be moved to respective Field classes. The base Field class should have a format method to be overridden. I was adding an international currency Field and would be able to put everything in a utils library outside of Django if this were changed.

Change History (3)

comment:1 by Alex Gaynor, 15 years ago

Resolution: wontfix
Status: newclosed

Marking as wontfix, the admin is separate from django.db.* quite intentionally, the idea is to sever that dependency as completely as possible, not increase it.

in reply to:  1 comment:2 by Joshua Russo, 15 years ago

Replying to Alex:

Marking as wontfix, the admin is separate from django.db.* quite intentionally, the idea is to sever that dependency as completely as possible, not increase it.

You wouldn't be putting admin functionality in the django.db.*. A shortcut for formatted output is something that would be nice to have in general and then the admin_list.py could just also make use of it, and there's no reason exceptions couldn't still be held in the admin_list.py.

comment:3 by Alex Gaynor, 15 years ago

Except this won't save any code within Django, because(for example) BooealnField.format() couldn't actually return what the admin uses since that would be making all sorts of assumptions we don't want to be making.

Note: See TracTickets for help on using tickets.
Back to Top