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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -