Skip to content

Commit

Permalink
startingt on view chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
shabda committed Mar 13, 2018
1 parent 2659f85 commit 80a5351
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/serailizers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Using the :code:`PollSerializer`

Let's use the serializer to create a :code:`Poll` object.

.. code-block:: python
.. code-block:: ipython
In [1]: from polls.serialzers import PollSerializer
Expand All @@ -93,12 +93,10 @@ Let's use the serializer to create a :code:`Poll` object.
Out[6]: 5
The :code:`poll.pk` line tells us that the object has been commited to the DB. You can also use the serializer to update a :code:`Poll` object.
The :code:`poll.pk` line tells us that the object has been commited to the DB. You can also use the serializer to update a :code:`Poll` object.::

.. code-block:: python

In [9]: poll_serializer = PollSerializer(instance=poll, data={"question": "Mojito, Caipirinha or margar
...: ita?", "created_by": 1})
In [9]: poll_serializer = PollSerializer(instance=poll, data={"question": "Mojito, Caipirinha or margarita?", "created_by": 1})

In [10]: poll_serializer.is_valid()
Out[10]: True
Expand Down
3 changes: 3 additions & 0 deletions docs/views-and-generic-views.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Views and Generic Views
============================


Creating Views
----------------
Expand Down

0 comments on commit 80a5351

Please sign in to comment.