You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
533 B
18 lines
533 B
from django.shortcuts import render
|
|
from django.views.generic import DetailView
|
|
from django.contrib.auth import get_user_model
|
|
|
|
from apps.course.models import Course
|
|
|
|
User = get_user_model()
|
|
|
|
|
|
class UserView(DetailView):
|
|
model = User
|
|
template_name = 'user/profile.html'
|
|
|
|
def get_context_data(self, object):
|
|
context = super().get_context_data()
|
|
context['published'] = Course.objects.filter(author=self.object, status=Course.PUBLISHED)
|
|
context['paid'] = Course.objects.none()
|
|
return context
|
|
|