'Process form and create DB objects as required'

def save(self, request):

    if self.instance:
        item = self.instance
    else:
        item = Item()
        item.item_type = self.item_type
    item.name = unicode(self.cleaned_data['name'])
    item.parent = self.cleaned_data['parent']
    item.status = self.cleaned_data['status']
    item.manufacturer = self.cleaned_data['manufacturer']
    item.supplier = self.cleaned_data['supplier']
    item.owner = self.cleaned_data['owner']
    item.location = self.cleaned_data['location']
    item.asset = self.cleaned_data['asset']
    if (not item.id):
        item.set_user_from_request(request)
    item.save()
    if self.instance:
        item.itemvalue_set.all().delete()
    for field in item.item_type.fields.all():
        for form_name in self.cleaned_data:
            if re.match(str((('^' + field.name) + '___\\d+$')), form_name):
                value = None
                if isinstance(self.fields[form_name], forms.FileField):
                    value = ItemValue(field=field, item=item, value=self._handle_uploaded_file(form_name))
                    if isinstance(self.fields[form_name], forms.ImageField):
                        self._image_resize(value.value)
                elif ((field.field_type == 'picture') and isinstance(self.fields[form_name], forms.ChoiceField)):
                    if (self.cleaned_data[form_name] != 'delete'):
                        value = ItemValue(field=field, item=item, value=self.cleaned_data[form_name])
                else:
                    value = ItemValue(field=field, item=item, value=self.cleaned_data[form_name])
                if value:
                    if (not value.value):
                        value.value = ''
                    value.save()
    return item
