예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
    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)
예제 #4
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     context['languages'] = Language.get_languages()
     context['title'] = 'Orders'
     return context
예제 #5
0
 def get_language(self):
     return Language.get_languages()
예제 #6
0
def save_languages():
    languages = load_from_json('languages')
    Language.objects.all().delete()
    for lang in languages:
        new_language = Language(**lang)
        new_language.save()