Advertisement
lamorfini

Untitled

May 19th, 2024
742
0
177 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. class Profile(mixins.LoginRequiredMixin, generic.DetailView):
  2.     model = User
  3.     def get_object(self):
  4.         return self.request.user
  5.     def get_context_data(self,*args, **kwargs):
  6.         context = super(Profile, self).get_context_data(*args,**kwargs)
  7.         context['pic'] = Photo.objects.filter(user=self.request.user).last
  8.         return context
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement