def item_to_model(item):
    model_class = getattr(item, 'django_model')
if not model_class:
    raise TypeError('Item is not a `DjangoItem` or is misconfigured')
return item.instance

def get_or_create(model):
    model_class = type(model)
created = False
try:
    obj = model_class.objects.get(name=model.name)
except model_class.DoesNotExist:
    created = True
obj = model
return obj, created

def update_model(destination, source, commit=True):
    pk = destination.pk
source_dict = model_to_dict(source)
for key, value in list(source_dict.items()):
    setattr(destination, key, value)
setattr(destination, 'pk', pk)
if commit:
    destination.save()
return destination
Как обновить DjangoItem в Scrapy