Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 4
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     context['languages'] = Language.get_languages()
     context['title'] = 'Orders'
     return context
Exemplo n.º 5
0
 def get_language(self):
     return Language.get_languages()
Exemplo n.º 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()