#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)
follow-up: 2 comment:1 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 16 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 , 16 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.
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.