Skip to content

Commit

Permalink
Add line numbering to code example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnns committed Mar 4, 2016
1 parent e0fae8d commit 9ec89fb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,17 @@ and exporting resource.
Importing data
==============

Let's import data::
Let's import some data!

.. code-block:: python
:linenos:
:emphasize-lines: 4,5
>>> import tablib
>>> from import_export import resources
>>> from core.models import Book
>>> book_resource = resources.modelresource_factory(model=Book)() # Line 4
>>> dataset = tablib.Dataset( # Line 5
... ['', 'New book'], headers=['id', 'name']
... )
>>> book_resource = resources.modelresource_factory(model=Book)()
>>> dataset = tablib.Dataset(['', 'New book'], headers=['id', 'name'])
>>> result = book_resource.import_data(dataset, dry_run=True)
>>> print result.has_errors()
False
Expand Down

0 comments on commit 9ec89fb

Please sign in to comment.