Skip to content

Commit

Permalink
Merge pull request #265 from manelclos/patch-4
Browse files Browse the repository at this point in the history
Document import_id_fields
  • Loading branch information
bmihelac committed May 12, 2015
2 parents 9b6e5fe + 805375a commit 27df389
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ An explicit order for exporting fields can be set using the ``export_order`` opt
fields = ('id', 'name', 'author', 'price',)
export_order = ('id', 'price', 'author', 'name')

The default field for object identification is ``id``, you can optionally set which fields are used as the ``id`` when importing::

class BookResource(resources.ModelResource):

class Meta:
model = Book
import_id_fields = ('isbn',)
fields = ('isbn', 'name', 'author', 'price',)

When defining ``ModelResource`` fields it is possible to follow
model relationships::

Expand Down

0 comments on commit 27df389

Please sign in to comment.