Skip to content

Commit

Permalink
Mark subheading correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
shabda committed Feb 6, 2018
1 parent dcc2335 commit ffcf3e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/calculated_fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can do this in two ways.


Adding a method to the model
===========================================================
++++++++++++++++++++++++++++++++++++++++++

You can add two methods to your :code:`Origin` model like this::

Expand All @@ -28,7 +28,7 @@ And change :code"`list_display` to :code:`list_display = ("name", "hero_count",


Adding a method to the ModelAdmin
===========================================================
++++++++++++++++++++++++++++++++++++++++++

If you don't want to add method to the model, you can do instead add the method to the ModelAdmin. ::

Expand All @@ -44,7 +44,7 @@ If you don't want to add method to the model, you can do instead add the method
The :code:`list_display`, as earlier, changes to :code:`list_display = ("name", "hero_count", "villain_count")`.

Performance considerations for calculated_fields
===========================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

With either of the above approaches, you would be running two exta queries per object (One per caluclated field). You can find how to optimize this in
:doc:`optimize_queries`.
Expand Down

0 comments on commit ffcf3e7

Please sign in to comment.