A
Size: a a a
A
AB
PB
AB
AB
АВ
DoesNotExist at /works/
Partitions matching query does not exist.
class WorksView(PartitionsView):
'''Вывод альбома работ'''
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
obj = self.get_obj()
catalogs = obj.catalog.all()
photoobjects = []
phobj_id = []
for cat in catalogs:
photoobjects.extend(cat.photoobject_set.all())
for obj in photoobjects:
phobj_id.append(obj.pk)
context['phobj'] = photoobjects
context['context_list'] = phobj_id
context['url_type'] = 'ajax'
context['url_get'] = '/works/'
context['current_photoobj'] = phobj_id[0]
return context
except:
pass
class PartitionsView(generic.base.TemplateView):
def get_obj(self):
try:
path = self.request.path
obj = models.Partitions.objects.get(url = path)
return obj
except Exception as e:
raise
def get_template_names(self):
try:
template_name = self.get_obj().template_name
return template_name
except Exception as e:
return 'core/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
context['partition'] = self.get_obj()
return context
except Exception as e:
raise
GT
DoesNotExist at /works/
Partitions matching query does not exist.
class WorksView(PartitionsView):
'''Вывод альбома работ'''
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
obj = self.get_obj()
catalogs = obj.catalog.all()
photoobjects = []
phobj_id = []
for cat in catalogs:
photoobjects.extend(cat.photoobject_set.all())
for obj in photoobjects:
phobj_id.append(obj.pk)
context['phobj'] = photoobjects
context['context_list'] = phobj_id
context['url_type'] = 'ajax'
context['url_get'] = '/works/'
context['current_photoobj'] = phobj_id[0]
return context
except:
pass
class PartitionsView(generic.base.TemplateView):
def get_obj(self):
try:
path = self.request.path
obj = models.Partitions.objects.get(url = path)
return obj
except Exception as e:
raise
def get_template_names(self):
try:
template_name = self.get_obj().template_name
return template_name
except Exception as e:
return 'core/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
context['partition'] = self.get_obj()
return context
except Exception as e:
raise
A
A
DoesNotExist at /works/
Partitions matching query does not exist.
class WorksView(PartitionsView):
'''Вывод альбома работ'''
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
obj = self.get_obj()
catalogs = obj.catalog.all()
photoobjects = []
phobj_id = []
for cat in catalogs:
photoobjects.extend(cat.photoobject_set.all())
for obj in photoobjects:
phobj_id.append(obj.pk)
context['phobj'] = photoobjects
context['context_list'] = phobj_id
context['url_type'] = 'ajax'
context['url_get'] = '/works/'
context['current_photoobj'] = phobj_id[0]
return context
except:
pass
class PartitionsView(generic.base.TemplateView):
def get_obj(self):
try:
path = self.request.path
obj = models.Partitions.objects.get(url = path)
return obj
except Exception as e:
raise
def get_template_names(self):
try:
template_name = self.get_obj().template_name
return template_name
except Exception as e:
return 'core/index.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
context['partition'] = self.get_obj()
return context
except Exception as e:
raise
АВ
A
АВ
A
АВ
АВ
NO
И
SK
R