From 9ec89fb5e5c319ddccbfb54d335a2c8ab743daf2 Mon Sep 17 00:00:00 2001 From: Jannis Date: Fri, 4 Mar 2016 15:05:53 +0100 Subject: [PATCH] Add line numbering to code example. --- docs/getting_started.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 42961081d..f0fee40bf 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -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