geodjango - Django ModelForm - just want to modify save() to have commit=False -
i trying use modelform of model fields users can submit data, want submissions emailed me instead of saved in database can check them on , add info rest of fields before saving.
so start off think need modify save() default modelform commit=false.
i've looked @ docs , since want change default on particular model commit=false wondering how simple modification. if below , email instance data myself.
class sk_form(modelform): class meta: model = soup_kitchen fields = ('name', 'address', 'phone_number', 'contact_person') def save(self, commit=true): instance = super(sk_form, self).save(commit=false) return instance
i don't think want do. if did way, data won't persisted anywhere. when receive email, you'll have cut , paste data django form recreate instance before can add own data , save it.
it better have boolean field on model - called example complete - records whether or not data has been checked , completed, , defaults false. can have custom manager default filters out rows complete=false.
Comments
Post a Comment