comparison content/Coding/030-retiring-get-profile-and-auth-profile-module.rst @ 17:fa54eda9b809

Fix typo in get_profile() post.
author Brian Neal <bgneal@gmail.com>
date Wed, 30 Jul 2014 20:16:40 -0500
parents 4280c90d5030
children 21a29f2520ca
comparison
equal deleted inserted replaced
16:4280c90d5030 17:fa54eda9b809
111 --------------------------- 111 ---------------------------
112 112
113 There are a few other things I recommend doing at this point. First I would 113 There are a few other things I recommend doing at this point. First I would
114 search your code for all occurrences of your ``Profile`` model. There were 114 search your code for all occurrences of your ``Profile`` model. There were
115 several places in my code where the extra database calls caused by 115 several places in my code where the extra database calls caused by
116 ``get_profile`` were hurting my performance. I had replaced ``get_profile()`` 116 ``get_profile()`` were hurting my performance. I had replaced ``get_profile()``
117 with custom code that queried the ``Profile`` manager directly to reduce 117 with custom code that queried the ``Profile`` manager directly to reduce
118 database calls. I reviewed these changes and replaced them with 118 database calls. I reviewed these changes and replaced them with
119 ``select_related()`` calls. This simplified things. I love deleting lines of 119 ``select_related()`` calls. This simplified things. I love deleting lines of
120 code. While I was doing this, I noticed a few places that I could use 120 code. While I was doing this, I noticed a few places that I could use
121 `prefetch_related()`_ (on other related fields) since my code pre-dated this 121 `prefetch_related()`_ (on other related fields) since my code pre-dated this