Permalink
Browse files

add public profile detail view

  • Loading branch information...
1 parent cd25a98 commit 50478382e1ef7c3f7383fd9b24af98fa5e4b50b1 Firass Asad committed with asadf Jan 26, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 roommate_search/views.py
@@ -70,6 +70,20 @@ class ProfileDetailView(GetProfileObject, DetailView):
pass
+class PublicProfileDetailView(DetailView):
+ model = Profile
+
+ def get_context_data(self, **kwargs):
+ context = super(PublicProfileDetailView, self).get_context_data(**kwargs)
+
+ # determine if the user has this profile starred
+ profile = Profile.objects.get(user=self.request.user)
+ starred = profile.stars.filter(id=self.get_object().id)
+
+ context["starred"] = starred
+ return context
+
+
class ProfileUpdateView(GetProfileObject, UpdateView):
pass

0 comments on commit 5047838

Please sign in to comment.