2009-08-19 43 views
0

怎麼生病顯示在管理部分的用戶圖片?,我正在尋找管理的模板,我看不到如何...Django,在管理員中顯示大拇指?

我認爲,Django顯示部分代碼中的字段(change_list模板),但是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 %} 

謝謝你們:)

回答

0

我們使用賈斯汀Driscoll的神話般django-photologue

如果photologue正確安裝(建議運行python manage.py plinit作爲安裝的一部分)和媒體正在被送達正確以下應爲您提供一個易於使用的admin_thumbnail()如下:

模型。 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, ...) 
+0

嗨,大家好,django-photologue es很好,但有畫廊用戶的問題..我想上傳圖像,並顯示一個大拇指 – Asinox 2009-08-26 19:09:30