Sorry. I pasted code that I was experimenting with. I thought maybe
the validation code was looking for strings because that is what the
error code said it was looking for. Before that I had been using
integers and that doesn't seem to work either. I am wondering if this
is a bug in Django 1.2. I hunted around on Django snippets as Bill
Freeman suggested and found the following code 
http://www.djangosnippets.org/snippets/1200/
for a custom multiple selection field.

I inserted it into my app and it doesn't want to validate the
selection either. In fact it returns a validation error message
similar to what I received from CommaSeperatedIntegerField and
CheckboxSelectMultiple. "Value [u'1'] is not a valid choice."

Not sure what is going on. Any insights would be appreciated.

On Apr 2, 3:06 pm, orokusaki <flashdesign...@gmail.com> wrote:
> The problem is that you're using '1' instead of 1. The comma
> separated integer list is expecting integers not strings. The reason
> you're seeing u'1' is because it's being turned from a string to a
> unicode object.
>
> Try this instead:
>
> SOME_CHOICES =  ((1, 'ch1'),(2, 'ch2'), (3, 'ch3'),(4, 'ch4'))

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

Reply via email to