Sunday, July 15, 2012

Re: Django Models: How to allow users to select an image from a choice of 3 pictures

На Sun, 15 Jul 2012 18:26:02 -0700 (PDT)
croberts <camdenroberts@gmail.com> написа:

> I am familiar with the use of Field.choices for text.
>
> However, I'd like the same option for images. Is this possible? I
> want users to select one image from a list of 3 and be able to save
> this. They can later come back in and change it if they wish. I
> know that in order to save this, it must be in Models.
>
> The idea:
>
> Each day, the has the option of selecting an image: happy face, sad
> face, smiley face of how they are feeling. Their selection is
> saved. They can go in later to change it if they wish.
>
> ImageField doesn't seem to do this. It seems to only allow for
> uploaded images as opposed to a choice.
>
Use Choice field with image in the option. You do not need FIleField,
couse you don't operate with files at all. You just want to put an
image in a select.

There are several ways to achieve this:
background image (pure html+css)
http://binnyva.blogspot.com/2006/01/icons-for-select-menu-options-in.html

Jquery UI;
or something like this:
http://www.marghoobsuleman.com/jquery-image-dropdown

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate