Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Profile(mixins.LoginRequiredMixin, generic.DetailView):
- model = User
- def get_object(self):
- return self.request.user
- def get_context_data(self,*args, **kwargs):
- context = super(Profile, self).get_context_data(*args,**kwargs)
- context['pic'] = Photo.objects.filter(user=self.request.user).last
- return context
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement