Skip to content

Commit

Permalink
Update SlugField editable tip (per @riseriyo)
Browse files Browse the repository at this point in the history
Fixes gh-131.
  • Loading branch information
treyhunner committed Nov 8, 2014
1 parent 69ccf37 commit 4f16eb5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tutorials/09-readable-urls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@ Now let's run our tests and make sure they still pass.
If you try to add an entry in the admin, you will notice that you
must write a slug (it isn't optional) but then whatever you write
is overwritten in the ``Entry.save()`` method. There are a couple
ways to resolve this but one way is to set the ``SlugField`` to be
``editable=False`` which will hide it in the admin or other forms.
ways to resolve this but one way is to set the ``SlugField`` in
our ``Entry`` model to be ``editable=False`` which will hide it in
the admin or other forms:

.. code-block:: python
slug = SlugField(editable=False)
See the Django docs on editable_ for details.

.. _editable: https://docs.djangoproject.com/en/1.7/ref/models/fields/#editable

0 comments on commit 4f16eb5

Please sign in to comment.