#5476 closed Uncategorized (wontfix)
Image thumbnails on image fields in the admin
Reported by: | Owned by: | xian | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | nfa-someday admin, thumbnails imagefields |
Cc: | jdunck+django@… | Triage Stage: | Design decision needed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I think it would be pretty nifty if the newforms-admin could render image thumbnails on image upload fields. It's a snippet but why do more when forms are already getting jazzed up and it goes a long way in usability? http://www.djangosnippets.org/snippets/239/
Attachments (3)
Change History (17)
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
follow-up: 3 comment:2 by , 17 years ago
comment:3 by , 17 years ago
Replying to deepak <deep.thukral@gmail.com>:
For the sake of simplicity -1 from me. Django shouldn't require any external package forcibly.
Django's ImageField
already requires PIL, so this wouldn't change anything. Similarly, XMLField
requires Jing, memcached caching requires the memcached bindings and using a database (except SQLite when using Python 2.5) requires a database adapter module.
comment:5 by , 17 years ago
Keywords: | admin thumbnails imagefields added |
---|---|
Owner: | changed from | to
Version: | SVN → newforms-admin |
Assigning this to myself and moving to newforms-admin. As I'm doing newforms-admin interface work. :)
I'd like to see thumbnails for imagefields in both the change_list and the form itself if there is already an image set. However this only makes sense to do if #4115 happens. And if it does it should happen in templates/templatetags for the admin not in the model as in the linked-to snippet.
comment:6 by , 17 years ago
Cc: | added |
---|
comment:7 by , 17 years ago
Keywords: | nfa-someday added |
---|
This functionality is not critical before the merge to trunk. Tagging with nfa-someday.
comment:8 by , 16 years ago
Hi!
I've recently attached patch, that shows image on admin page:
image = models.ImageField(admin_preview=True)
I'm going to create generic way of creating thumbnails, so could you give me a tip.
I think that should be field, e.g.
image_thumb = ImageThumbField(thumb_for='image', thumbnalizer=create_100x100_thumb)
so adding thumbs to list_view will be as easy as:
def get_thumb(self): return '<img src="%s" />' % self.get_thumb_url get_thumbs.allow_tags=True
or even:
@image_tag_for('thumb') def get_thumb(): pass
comment:9 by , 16 years ago
Version: | newforms-admin → SVN |
---|
comment:10 by , 16 years ago
This snippet is a much better starting point:
http://www.djangosnippets.org/snippets/934/
I just looked around in the source files and I think it cannot be done with template work alone, but one has to create an ImageWidget for the admin like in the snippet. I got this code working on my site in a few minutes and I think this would be a good basis for a patch. It only depends on PIL but degrades gracefully if not present.
Is there anything I can do to help (I have not yet contributed to Django code, so would need some guidance)
comment:11 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
There seem to be too many variable preferences required here for how the thumbnail display would work. It's a lot of complexity to put it into the admin by default. Fortunately, it's possible without modifying Django for individual apps: specify a model form on the ModelAdmin
subclass and a widget for that field that is the custom widget that display the thumbnail.
comment:12 by , 12 years ago
Easy pickings: | unset |
---|---|
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
comment:13 by , 11 years ago
@mtredinnick It's easy to say "it's easy"; it's harder (though not all that much) to actually provide documentation and example code so that a non-Django-expert can understand how to add thumbnails to their admin.
In other words, you can quibble over whether or not thumbnail support should be built in to Django, but you can't argue with the fact that right now it's more difficult than it needs to be for someone to have thumbnails in their admin. If it's not going to be built in, it would benefit Django to have some explanation of the non-built-in way of doing thumbnails.
comment:14 by , 11 years ago
Firstly - It's worth pointing out that @mtredinnick is deceased.
Secondly, you've apparently missed the point of what he was saying -- there isn't a single, obvious way to do this. It would be impossible for Django to document how it could be done without "blessing" a particular approach. This would almost certainly involve blessing one of the third-party thumbnailing libraries, (sorl-thumbnails and easy-thumbnails to pick just two).
More broadly, as a project, we have an open problem of helping newcomers find appropriate third-party tools in the Django ecosystem. However, I don't think we can address that problem by documenting examples that use selected packages.
For the sake of simplicity -1 from me. Django shouldn't require any external package forcibly.