0
I have a system that will have the option of choosing 1 or multiple options in the same field. Bad problem is that I need my field inside the model to be charfield and in Forms to be Multiplechoicefield to be able to validate multiple choices. I know I could use the filedmultiple in the model and it would work, but that means Dari error in Django filter. I need that as the model is now, both Forms and model, but that it goes into the clean values and not as it is passing now, now passes like this:['Dog', 'Cat', 'Birds']
py.models
PETN_CHOICES = (
('Cachorro','Cachorro'), ('Gato','Gato'), ('Pássaros', 'Pássaros'), ('Peixes','Peixes'), ('Reptéis','Reptéis'), ('Roedores','Roedores')
)
class Negocio(models.Model):
pet_aceitos = models.CharField(max_length=255, choices=PETN_CHOICES)
Forms.py
PETN_CHOICES = (
('Cachorro','Cachorro'), ('Gato','Gato'), ('Pássaros', 'Pássaros'), ('Peixes','Peixes'), ('Reptéis','Reptéis'), ('Roedores','Roedores')
)
class NegocioForm(UserCreationForm):
pet_aceitos = forms.MultipleChoiceField(
widget=forms.CheckboxSelectMultiple, choices=PETN_CHOICES, )