You can't include images in the options of a typycal html dropdown To do so you need to use JavaScript, for example this plugin
http://designwithpc.com/plugins/ddslick#demo And pass the options in the format specified by the plugin On Mon, Mar 23, 2015 at 1:51 PM, Sandeep kaur <mkaurkha...@gmail.com> wrote: > Anybody please help. > > On Sun, Mar 22, 2015 at 3:07 PM, Sandeep kaur <mkaurkha...@gmail.com> > wrote: > >> Greetings, >> I want to have the thumnails of images with the names in the dropdown >> field of form. To return the image as foreign key field, I have used this >> code : >> def __unicode__(self): >> image_data = >> open("/home/sandy/whats-fresh-api/media/images/download.jpg", "rb").read() >> return '%s' % (self.name) + HttpResponse(image_data, >> content_type="image/jpg") >> >> But it give following error : >> Exception Value: >> >> coercing to Unicode: need string or buffer, HttpResponse found >> >> >> Is it possible to do this ? >> >> Thanks. >> >> -- >> Sandeep Kaur >> Blog: sandymadaan.wordpress.com >> SCM: https://github.com/sandeepmadaan >> >> >> >> > > > -- > Sandeep Kaur > Blog: sandymadaan.wordpress.com > SCM: https://github.com/sandeepmadaan > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAF66xG00kpdSJqW-2D7W_HYR4e%3DVEeW3E81KMHBoU-OhDbUFNA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAF66xG00kpdSJqW-2D7W_HYR4e%3DVEeW3E81KMHBoU-OhDbUFNA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei06ociqOZPdGgccgO%3Db6cwegvu02oat48kFcQj1O%2B_fvg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.