def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['languages'] = Language.get_languages() context['title'] = 'Language course' context['current_course'] = self.course context['paginator_path'] = self.request.path return context
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['languages'] = Language.get_languages() context['title'] = 'Teacher' context['teacher'] = self.teacher context['paginator_path'] = self.request.path return context
def get(self, request): basket_items = Basket.get_items(request) client_id = settings.CLIENT_ID context = { 'title': 'Basket', 'languages': Language.get_languages(), 'basket_items': basket_items, 'client_id': client_id, } return render(request, self.template_name, context)
def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['languages'] = Language.get_languages() context['title'] = 'Orders' return context
def get_language(self): return Language.get_languages()
def save_languages(): languages = load_from_json('languages') Language.objects.all().delete() for lang in languages: new_language = Language(**lang) new_language.save()