parent
bf491392cf
commit
a16eeb0d12
2 changed files with 18 additions and 1 deletions
@ -1,3 +1,18 @@ |
||||
from django.shortcuts import render |
||||
from django.views.generic import DetailView |
||||
from django.contrib.auth import get_user_model |
||||
|
||||
# Create your views here. |
||||
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 |
||||
|
||||
Loading…
Reference in new issue