def save(self, **kwargs):
    '\n        Create a ``FormEntry`` instance and related ``FieldEntry``\n        instances for each form field.\n        '
    entry = super(FormForForm, self).save(commit=False)
    entry.form = self.form
    entry.entry_time = now()
    entry.save()
    entry_fields = entry.fields.values_list('field_id', flat=True)
    new_entry_fields = []
    for field in self.form_fields:
        field_key = ('field_%s' % field.id)
        value = self.cleaned_data[field_key]
        if (value and self.fields[field_key].widget.needs_multipart_form):
            value = fs.save(join('forms', str(uuid4()), value.name), value)
        if isinstance(value, list):
            value = ', '.join([v.strip() for v in value])
        if (field.id in entry_fields):
            field_entry = entry.fields.get(field_id=field.id)
            field_entry.value = value
            field_entry.save()
        else:
            new = {'entry': entry, 'field_id': field.id, 'value': value}
            new_entry_fields.append(FieldEntry(**new))
    if new_entry_fields:
        FieldEntry.objects.bulk_create(new_entry_fields)
    return entry
Create a ``FormEntry`` instance and related ``FieldEntry``
instances for each form field.
def save(self, **kwargs):
    '\n        Create a ``FormEntry`` instance and related ``FieldEntry``\n        instances for each form field.\n        '
    entry = super(FormForForm, self).save(commit=False)
    entry.form = self.form
    entry.entry_time = now()
    entry.save()
    entry_fields = entry.fields.values_list('field_id', flat=True)
    new_entry_fields = []
    for field in self.form_fields:
        field_key = ('field_%s' % field.id)
        value = self.cleaned_data[field_key]
        if (value and self.fields[field_key].widget.needs_multipart_form):
            value = fs.save(join('forms', str(uuid4()), value.name), value)
        if isinstance(value, list):
            value = ', '.join([v.strip() for v in value])
        if (field.id in entry_fields):
            field_entry = entry.fields.get(field_id=field.id)
            field_entry.value = value
            field_entry.save()
        else:
            new = {'entry': entry, 'field_id': field.id, 'value': value}
            new_entry_fields.append(FieldEntry(**new))
    if new_entry_fields:
        FieldEntry.objects.bulk_create(new_entry_fields)
    return entry