Hello list, i have a newbie question

My code
----------------------------------
class Format(models.Model):
    name = models.CharField(max_length=5, unique=True)
    myBoolean = models.BooleanField(default=False)

class FormFormat(forms.ModelForm):
    boolean1 = forms.BooleanField(required=False)
    boolean2 = forms.BooleanField(required=False)

    class Meta:
        model = Format
        fields = ['name']

FormsetFormFormat = forms.models.modelformset_factory(Format,
max_num=0,form=FormFormat)
----------------------------------
The idea is this:

if boolean1=True and boolean2=True the field myBoolean must to be True
if boolean1=True and boolean2=False the field myBoolean must to be
False
...
My question is, how i can do this?
overwriting the save method?

I don't have idea, because boolean1 and boolean2 are form fields not
model fields. Can i pass custom parameters to the save method?

Thanks for read

P.D.:sorry for my poor english

-- 
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