views:

230

answers:

2

Hi guys, how ill show in the admin section the user picture?, i was looking the template of the admin and i can't see how...

i think that Django show the fields in the section code (change_list template), but jeje ..how? jeje

{% block result_list %}
          {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %}
          {% result_list cl %}          
          {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %}
      {% endblock %}

Thanks guys :)

A: 

We use Justin Driscoll's fabulous django-photologue.

If photologue is installed properly (recommend running python manage.py plinit as part of the installation) and the media is being served correctly the following should provide you with an easy-to-use admin_thumbnail() as follows:

models.py

from photologue.models import Photo

class Entry(models.Model):
    entry_photo = models.ForeignKey(Photo)
    ...

admin.py

def show_entry_thumbnail(item):
    return item.entry_photo.admin_thumbnail()
show_entry_thumbnail.short_description = _('Entry Photo')


class ItemAdmin(admin.ModelAdmin):
    list_display = (show_entry_thumbnail, ... )
elena
hi guys, django-photologue es fine, but have problem with gallery user.. i want upload image and show a thumbs
Asinox
A: 

There also appears to be an alternative method using sorl-thumbnail: it's mentioned here.

elena

related questions