Esempio n. 1
0
 def get_context_data(self, **kwargs):
     # Call the base implementation first to get a context
     context = super().get_context_data(**kwargs)
     # Add in a QuerySet of all the books
     context['profile'] = get_object_or_404(Profile, id=self.request.user.id)
     context['choices'] = Profile.get_choices()
     # if they have received interest from us.
     context['selected_profiles'] = Profile.objects.filter(interest_received__id=self.request.user.id)
     context['new_profiles'] = Profile.objects.exclude(interest_received__id=self.request.user.id)
     return context