Compare commits
1 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
aace6dd8df | 7 years ago |
14 changed files with 103 additions and 95 deletions
@ -1,23 +1,23 @@ |
|||||||
from django.views.generic import TemplateView |
from django.views.generic import TemplateView |
||||||
from django.utils.translation import ugettext_lazy as _ |
from django.utils.translation import ugettext_lazy as _ |
||||||
|
|
||||||
from cart.models import Client |
# from cart.models import Client |
||||||
from core.models import Certificate |
# from core.models import Certificate |
||||||
|
|
||||||
|
|
||||||
class IndexView(TemplateView): |
class IndexView(TemplateView): |
||||||
template_name = 'index/index.html' |
template_name = 'index/index.html' |
||||||
title = _('Русские программы') |
title = _('Русские программы') |
||||||
|
|
||||||
def get_clients(self): |
# def get_clients(self): |
||||||
return Client.active.only('name', 'image').all() |
# return Client.active.only('name', 'image').all() |
||||||
|
# |
||||||
def get_certs(self): |
# def get_certs(self): |
||||||
return Certificate.active.only('name', 'image').all() |
# return Certificate.active.only('name', 'image').all() |
||||||
|
|
||||||
def get_context_data(self, **kwargs): |
def get_context_data(self, **kwargs): |
||||||
context = super().get_context_data(**kwargs) |
context = super().get_context_data(**kwargs) |
||||||
context['title'] = self.title |
context['title'] = self.title |
||||||
context['clients'] = self.get_clients() |
# context['clients'] = self.get_clients() |
||||||
context['certs'] = self.get_certs() |
# context['certs'] = self.get_certs() |
||||||
return context |
return context |
||||||
|
|||||||
Loading…
Reference in new issue