Конечно, а почему бы и нет?
Просто абстрагируйте код следующим образом:
class View1(View):
def get(self, request, *args, **kwargs):
[...]
context = makeContext(request, user, Adverts) # or whoever `user` is
return render(request, 'template.html', context)
def makeContext(request, user, model):
new_user = User.objects.get(username=user)
user_profile = Profile.objects.get(user=new_user)
objects = model.objects.filter(user=new_user)
editable = False
if request.user.username == user:
editable = True
context = {
"objects": objects,
"user_profile": user_profile,
"no_data": "No comments",
"editable": editable,
"user": user
}
return context