google-code-export / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
0 stars 0 forks source link

Feature Request: AdminImageWidget - Custom widget for displaying image in a ImageField. #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've recently hacked up the AdminImageWidget from
http://www.djangosnippets.org/snippets/934/ to work (style-wise) with
grappelli.  Is it possible to include this widget in the grappelli package
as its something that effects the look-and-feel of the admin site.

Usage:
'''
from grappelli.widgets import AdminImageWidget

class UserProfileAdmin(admin.ModelAdmin):
  formfield_overrides = {models.ImageField: {'widget': AdminImageWidget}}
'''

Attached is the widgets.py source code and an image showing how it looks in
practice.

Note: I've resized the image to 80x80 for looks (it use's the
sorl-thumbnail library if available).

Original issue reported on code.google.com by Gontro@gmail.com on 19 Aug 2009 at 6:32

Attachments:

GoogleCodeExporter commented 9 years ago
for cases like this we recommend using the django-filebrowser (resp. the
filebrowsefield).

problem with the given widget: it requires sorl. if sorl is not installed, the
original image will be shown (which totally breaks the interface, if the image 
is too
big).

therefore, a wontfix. sorry.

Original comment by sehmaschine on 19 Aug 2009 at 7:17