Django

Code

Ticket #5476 (new)

Opened 1 year ago

Last modified 3 months ago

Image thumbnails on image fields in the admin

Reported by: rich@richardcornish.com Assigned to: xian
Milestone: Component: django.contrib.admin
Version: SVN Keywords: nfa-someday admin, thumbnails imagefields
Cc: jdunck+django@gmail.com Triage Stage: Design decision needed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

image-preview-in-admin.patch (2.6 kB) - added by vitja on 07/14/08 09:57:27.
preview image on model admin page
image-preview-in-admin.diff (2.6 kB) - added by vitja on 07/17/08 05:34:26.
preview image on model admin page
thumbnail-field-and-example.py (2.5 kB) - added by vitja on 07/17/08 05:35:28.
thumbnail field

Change History

09/15/07 17:47:24 changed by webjunkie

  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs changed.

(follow-up: ↓ 3 ) 09/16/07 02:14:13 changed by deepak <deep.thukral@gmail.com>

For the sake of simplicity -1 from me. Django shouldn't require any external package forcibly.

(in reply to: ↑ 2 ) 09/16/07 02:57:55 changed by ubernostrum

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.

09/16/07 17:16:15 changed by ubernostrum

See also #4115 and #961.

09/24/07 23:01:31 changed by xian

  • keywords set to admin, thumbnails imagefields.
  • owner changed from nobody to xian.
  • version changed from SVN to 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.

12/01/07 11:49:56 changed by anonymous

  • cc set to jdunck+django@gmail.com.

12/07/07 20:25:42 changed by brosner

  • keywords changed from admin, thumbnails imagefields to nfa-someday admin, thumbnails imagefields.

This functionality is not critical before the merge to trunk. Tagging with nfa-someday.

07/14/08 09:57:27 changed by vitja

  • attachment image-preview-in-admin.patch added.

preview image on model admin page

07/14/08 10:09:08 changed by vitja

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

07/17/08 05:34:26 changed by vitja

  • attachment image-preview-in-admin.diff added.

preview image on model admin page

07/17/08 05:35:28 changed by vitja

  • attachment thumbnail-field-and-example.py added.

thumbnail field

07/19/08 16:43:36 changed by Alex

  • version changed from newforms-admin to SVN.

Add/Change #5476 (Image thumbnails on image fields in the admin)




Change Properties
Action