Exemple #1
0
 def form_valid(self, form):
     '''
     avoid saving the form twice (and thus sending emails twice)
     '''
     return ModelFormMixin.form_valid(self, form)
 def form_valid(self, form):
     ModelFormMixin.form_valid(self, form)
     return HttpResponse(json.dumps({'success':True, 'object':form.instance.dump(), "object_pk":unicode(form.instance.pk)}, ensure_ascii=False),
                         mimetype='application/json')