Hello,

You overwright in forms.py in your form save()

Example:

def save(self, commit=True):
    instance = super(MyForm, self).save(commit=False)
    instance.flag1 = 'flag1' in self.cleaned_data['multi_choice'] # etc
    if commit:
        instance.save()
    return instance


'MH' via Django users <django-users@googlegroups.com> schrieb am Sa., 12.
Feb. 2022, 22:11:

> Hi
>
> I have an update view which enables me via a form to update the data for a
> particular model object instance (as it should do). However, when a
> particular field gets changed I would not only need to update the fields in
> the database, but I would need the save routine of the update view to
> trigger a computation and to update another field with a new value as well.
> How can this be done?
>
> Best regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8aa6e29d-77a9-4658-b0a6-f7d8b8af7993n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8aa6e29d-77a9-4658-b0a6-f7d8b8af7993n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKGT9mzhL7c2cxiDPH4WFagFCezm1hju%3DGcAxs_BnuCgVkQ8dw%40mail.gmail.com.

Reply via email to