From 82eb9de99335c0032986fb3273f9951756205fb9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 4 Oct 2010 17:44:40 -0500 Subject: 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 --- public/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public') 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." -- cgit v1.2.3-24-g4f1b