|
|
|
@ -1,10 +1,11 @@ |
|
|
|
from django.contrib.auth import get_user_model |
|
|
|
from django.contrib.auth import get_user_model |
|
|
|
from django.contrib.auth.decorators import login_required, user_passes_test |
|
|
|
from django.contrib.auth.decorators import login_required, user_passes_test |
|
|
|
|
|
|
|
from django.db.models import Min |
|
|
|
from django.shortcuts import get_object_or_404 |
|
|
|
from django.shortcuts import get_object_or_404 |
|
|
|
from django.utils.decorators import method_decorator |
|
|
|
from django.utils.decorators import method_decorator |
|
|
|
from django.views.generic import ListView, UpdateView, TemplateView, DetailView |
|
|
|
from django.views.generic import ListView, UpdateView, TemplateView, DetailView |
|
|
|
|
|
|
|
|
|
|
|
from .models import LiveLesson |
|
|
|
from .models import LiveLesson, SchoolSchedule |
|
|
|
|
|
|
|
|
|
|
|
User = get_user_model() |
|
|
|
User = get_user_model() |
|
|
|
|
|
|
|
|
|
|
|
@ -47,3 +48,15 @@ class LiveLessonEditView(TemplateView): |
|
|
|
context['object'] = self.object |
|
|
|
context['object'] = self.object |
|
|
|
context['live'] = 'true' |
|
|
|
context['live'] = 'true' |
|
|
|
return context |
|
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SchoolView(TemplateView): |
|
|
|
|
|
|
|
template_name = 'school/school.html' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self): |
|
|
|
|
|
|
|
context = super().get_context_data() |
|
|
|
|
|
|
|
context.update({ |
|
|
|
|
|
|
|
'school_schedules': SchoolSchedule.objects.all(), |
|
|
|
|
|
|
|
'min_school_price': SchoolSchedule.objects.all().aggregate(Min('month_price'))['month_price__min'], |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return context |
|
|
|
|