summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-10-05 00:44:40 +0200
committerDan McGee <dan@archlinux.org>2010-10-05 00:44:40 +0200
commit82eb9de99335c0032986fb3273f9951756205fb9 (patch)
treee3f5270af40d9b840f7798b9ac40476de368523e /public
parente847030d83796a5f8cccce2fb409dd4d672f71f3 (diff)
downloadarchweb-82eb9de99335c0032986fb3273f9951756205fb9.tar.gz
archweb-82eb9de99335c0032986fb3273f9951756205fb9.tar.xz
Make user profile a OneToOneField
We had this set up as a unique ForeignKey before, which adds some indirection due to the RelatedManager object being there. By making it a OneToOneField, we can get the profile object directly, enforce uniqueness, and also use it in select_related() calls to make our profiles page a bit more efficient. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'public')
-rw-r--r--public/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/public/views.py b/public/views.py
index 0661db6..7d10e74 100644
--- a/public/views.py
+++ b/public/views.py
@@ -18,7 +18,7 @@ def index(request):
return direct_to_template(request, 'public/index.html', context)
def userlist(request, type='Developers'):
- users = User.objects.order_by('username')
+ users = User.objects.order_by('username').select_related('userprofile')
if type == 'Developers':
users = users.filter(is_active=True, groups__name="Developers")
msg = "This is a list of the current Arch Linux Developers. They maintain the [core] and [extra] package repositories in addition to doing any other developer duties."