Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-15 Thread Nuno Maltez
Hi, I think the problem is tyhat you're using the wrong type of field in your form. A ChoiceField, like the documentations says [1], returns '' for an empty value, i.e. when you do not select an option. Trying to save an empty string into ans INT field in the database will throw the error you

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread geraldcor
That was a very good guess. I tried it but it didn't work. On Apr 13, 12:46 pm, johan sommerfeld wrote: >  You could try using initial=0. > > /J > > On Tuesday, April 13, 2010, geraldcor wrote: > > Hello all, > > > I know the error "invalid

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread johan sommerfeld
You could try using initial=0. /J On Tuesday, April 13, 2010, geraldcor wrote: > Hello all, > > I know the error "invalid literal for int() with base 10: '' " has > been discussed a lot in the past, but this seems to be unique to my > situation. > > I have 2 choice fields

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread bfrederi
I happened to be stopping by to post my own question, and I don't know if this is the answer or not, but have you tried adding the argument blank=True to your model field? http://docs.djangoproject.com/en/dev/ref/models/fields/#blank -- You received this message because you are subscribed to the

ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread geraldcor
Hello all, I know the error "invalid literal for int() with base 10: '' " has been discussed a lot in the past, but this seems to be unique to my situation. I have 2 choice fields as defined below for both the model and form: models.py class Checkin(models.Model): ... content =