Scrapy, a fast high-level web crawling & scraping framework for Python.
Proposed Changes
Emanuel Schorschf9b130da1244
diff --git a/docs/topics/djangoitem.rst b/docs/topics/djangoitem.rstindex 88e4c83e2..02c37e6c9 100644--- a/docs/topics/djangoitem.rst+++ b/docs/topics/djangoitem.rst@@ -24,14 +24,16 @@ override fields that are present in the model defining them in the item.Let's see some examples:-Django model for the examples::-+Creating a Django model for the examples::++ from django.db import modelsclass Person(models.Model):name = models.CharField(max_length=255)age = models.IntegerField()Defining a basic :class:`DjangoItem`::-++ from scrapy.contrib.djangoitem import DjangoItemclass PersonItem(DjangoItem):django_model = Person@@ -52,7 +54,7 @@ To obtain the Django model from the item, we call the extra method>>> person.id1-As you see the model is already saved when we call :meth:`~DjangoItem.save`, we+The model is already saved when we call :meth:`~DjangoItem.save`, wecan prevent this by calling it with ``commit=False``. We can use``commit=False`` in :meth:`~DjangoItem.save` method to obtain an unsaved model::