0.4.0 projects
This commit is contained in:
@@ -7,6 +7,9 @@ from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.core.validators import validate_image_file_extension
|
||||
|
||||
from PortfolioApp.models import Project
|
||||
|
||||
|
||||
class BlockPluginPresentation(Block_Abstract):
|
||||
from BaseModels.base_models import Manager_Enabled
|
||||
objects = models.Manager()
|
||||
@@ -59,6 +62,12 @@ class Section(BaseModelViewPage):
|
||||
related_query_name='grel_%(class)s_for_block_plugin_presentation')
|
||||
|
||||
|
||||
def get_projects(self):
|
||||
services_ids = self.rel_services_for_section.filter(enable=True).order_by('order').values_list('id', flat=True)
|
||||
projects = Project.objects.filter(services__id=services_ids)
|
||||
return projects
|
||||
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Раздел сайта')
|
||||
verbose_name_plural = _('Разделы сайта')
|
||||
|
||||
Reference in New Issue
Block a user