Python论坛  - 讨论区

标题:[python-chinese] django 自带的后台管理系统中的list_display时,能不能显示出图片?

2007年05月15日 星期二 14:13

xiaoyi tian purpen.w在gmail.com
星期二 五月 15 14:13:25 HKT 2007

ÎÒÏëÔÚlist_displayʱÏÔʾ³öͼƬ£¬¶ø²»Êǵ¥µ¥Í¼Æ¬µÄ·¾¶£¬¿ÉÒÔÂð£¿

¸ÃÔõÑù×ö?

-- 
ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070515/d1d78849/attachment-0001.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年05月15日 星期二 15:47

黄毅 yi.codeplayer在gmail.com
星期二 五月 15 15:47:53 HKT 2007

def image_tag(self):return http://www.djangoproject.com/documentation/model-api/#list-display


On 5/15/07, xiaoyi tian <purpen.w at gmail.com> wrote:
>
> 我想在list_display时显示出图片,而不是单单图片的路径,可以吗?
>
> 该怎样做?
>
> --
> 人生就像一个瓶子,而生活就是瓶子里的水。
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
http://codeplayer.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070515/4a60b379/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年05月15日 星期二 16:03

xiaoyi tian purpen.w在gmail.com
星期二 五月 15 16:03:07 HKT 2007

ÎÒÊÇÕâÑùÉèÖõÄ:

Temp_Pic = models.ImageField('Ä£°åЧ¹ûͼ', default='None.jpg',
upload_to='template_pic')

def display_picture(self):
        return '' % (self.Temp_Pic)
    display_picture.show_tags=True

µ«ÏÔʾµÄÊÇ×Ö·û´®

¶ø²»ÊÇͼƬ...


ÔÚ07-5-15£¬»ÆÒã <yi.codeplayer在gmail.com> дµÀ£º
>
> def image_tag(self):return > image_tag.show_tags=True
>
> http://www.djangoproject.com/documentation/model-api/#list-display
>
>
> On 5/15/07, xiaoyi tian <purpen.w在gmail.com> wrote:
>
> > ÎÒÏëÔÚlist_displayʱÏÔʾ³öͼƬ£¬¶ø²»Êǵ¥µ¥Í¼Æ¬µÄ·¾¶£¬¿ÉÒÔÂð£¿
> >
> > ¸ÃÔõÑù×ö?
> >
> > --
> > ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> --
> http://codeplayer.blogspot.com/
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070515/e1d5eb8c/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年05月15日 星期二 16:34

xiaoyi tian purpen.w在gmail.com
星期二 五月 15 16:34:57 HKT 2007

¶àл£¬½â¾öÁË¡£

ÔÚ07-5-15£¬xiaoyi tian <purpen.w在gmail.com> дµÀ£º
>
> ÎÒÊÇÕâÑùÉèÖõÄ:
>
> Temp_Pic = models.ImageField('Ä£°åЧ¹ûͼ', default='None.jpg',
> upload_to='template_pic')
>
> def display_picture(self):
>         return '' % (
> self.Temp_Pic)
>     display_picture.show_tags=True
>
> µ«ÏÔʾµÄÊÇ×Ö·û´®
> > height="80" />
> ¶ø²»ÊÇͼƬ...
>
>
> ÔÚ07-5-15£¬»ÆÒã <yi.codeplayer在gmail.com> дµÀ£º
> >
> > def image_tag(self):return > > image_tag.show_tags=True
> >
> > http://www.djangoproject.com/documentation/model-api/#list-display
> >
> >
> > On 5/15/07, xiaoyi tian < purpen.w在gmail.com> wrote:
> >
> > > ÎÒÏëÔÚlist_displayʱÏÔʾ³öͼƬ£¬¶ø²»Êǵ¥µ¥Í¼Æ¬µÄ·¾¶£¬¿ÉÒÔÂð£¿
> > >
> > > ¸ÃÔõÑù×ö?
> > >
> > > --
> > > ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> >
> >
> >
> > --
> > http://codeplayer.blogspot.com/
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> --
> ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£




-- 
ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070515/c84820a1/attachment-0001.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年05月15日 星期二 16:40

xiaoyi tian purpen.w在gmail.com
星期二 五月 15 16:40:59 HKT 2007

²»¹ý²»ÊÇshow_tags¶øÊÇallow_tags.

ÔÚ07-5-15£¬xiaoyi tian <purpen.w在gmail.com> дµÀ£º
>
> ¶àл£¬½â¾öÁË¡£
>
> ÔÚ07-5-15£¬xiaoyi tian <purpen.w在gmail.com> дµÀ£º
> >
> > ÎÒÊÇÕâÑùÉèÖõÄ:
> >
> > Temp_Pic = models.ImageField('Ä£°åЧ¹ûͼ', default='None.jpg',
> > upload_to='template_pic')
> >
> > def display_picture(self):
> >         return '' % (
> > self.Temp_Pic)
> >     display_picture.show_tags=True
> >
> > µ«ÏÔʾµÄÊÇ×Ö·û´®
> > > > width="100", height="80" />
> > ¶ø²»ÊÇͼƬ...
> >
> >
> > ÔÚ07-5-15£¬»ÆÒã <yi.codeplayer在gmail.com> дµÀ£º
> > >
> > > def image_tag(self):return > > > image_tag.show_tags=True
> > >
> > > http://www.djangoproject.com/documentation/model-api/#list-display
> > >
> > >
> > > On 5/15/07, xiaoyi tian < purpen.w在gmail.com> wrote:
> > >
> > > > ÎÒÏëÔÚlist_displayʱÏÔʾ³öͼƬ£¬¶ø²»Êǵ¥µ¥Í¼Æ¬µÄ·¾¶£¬¿ÉÒÔÂð£¿
> > > >
> > > > ¸ÃÔõÑù×ö?
> > > >
> > > > --
> > > > ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
> > > > _______________________________________________
> > > > python-chinese
> > > > Post: send python-chinese在lists.python.cn
> > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > > Unsubscribe: send unsubscribe to
> > > > python-chinese-request在lists.python.cn
> > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > > >
> > >
> > >
> > >
> > > --
> > > http://codeplayer.blogspot.com/
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> >
> >
> >
> > --
> > ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
>
>
>
>
> --
> ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£




-- 
ÈËÉú¾ÍÏñÒ»¸öÆ¿×Ó£¬¶øÉú»î¾ÍÊÇÆ¿×ÓÀïµÄË®¡£
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070515/0c7ed776/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号