1 2 3 4 5 6 7 8 9 10 11 12 | class ContactForm(forms.Form):
def save(self, session=None, app_label=None):
""" Save or update a new `Contact` """
# create this composite entity
_data = {}
for key,val in self.cleaned_data.items():
_data[app_label+'--%s' % key] = val
fs = FieldSet(Contact, session=session, data=_data)
if fs.validate():
fs.sync()
return None
|
More like this
- Using another memcached for sessions by dipankarsarkar 4 years, 7 months ago
- HTTP authentication using your ModelBackend by dipankarsarkar 4 years, 7 months ago
- Django Row Level Locking (Prevents race conditions if used correctly) by sleepycal 3 years ago
- newforms: Add field-specific error in form.clean() by miracle2k 5 years, 11 months ago
- Contact Form by henrikv 6 years, 3 months ago
Comments
first snippet :-)
#