I'm using MySQL
my table model :
class Offer(models.Model):
...
additional=models.CharField('Dodatkowe informacje',max_length="100",choices=ADDITIONAL_CHOICES.items(),blank=True)
...
my form: class OfferForm(forms.ModelForm): additional=forms.MultipleChoiceField(label='dodatkowe informacje',choices=ADDITIONAL_CHOICES.items(),required=False) class Meta: model=Offer
while saving form i receive this error :
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), description
= 'sagas', local_h
= '12.3450000000', local_w
= '45.0940000' at line 1")
sql looks like this:
'UPDATE offers_offer
SET cat_id
= 2, type
= 2, estate_type
= 3, created
= \'2009-03-17 01:58:31\', area
= \'3245.000\', city
= \'sdfghksdj\', district
= \'gksdgj\', price
= \'235252.000\', additional
= ("\'1\'",), description
= \'sagas\', local_h
= \'12.3450000000\', local_w
= \'45.0940000000\', gmapimg
= \'\', title
= \'dgsg\', meta
= \'sdgs\', publish
= 1 WHERE offers_offer
.id
= 3 '
when I used postgre I didn't this error :/ now I work with MySQL and have no ideas maybe i should use other fild type than vchar ?