0.4.1 projects
This commit is contained in:
18
GeneralApp/migrations/0023_alter_block_block_type.py
Normal file
18
GeneralApp/migrations/0023_alter_block_block_type.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.7 on 2023-12-10 17:16
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('GeneralApp', '0022_alter_office_work_time_from_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='block',
|
||||
name='block_type',
|
||||
field=models.CharField(choices=[('photo_n_text', 'Фото с одной стороны + Текст с другой стороны'), ('main_block_w_subblocks', 'Блок с подблоками'), ('present_technology_block', 'описание и НАЗВАНИЕ слева + Картинка справа'), ('photo150_n_title', 'Фото 150x150 сверху + заголовок под фото'), ('how_work', 'Как с нами работать'), ('how_dev', 'Как ведется разработка'), ('feedback_form', 'Форма обратной связи'), ('projects_block', 'Блок проектов')], default='photo_n_text', max_length=100, verbose_name='Тип блока'),
|
||||
),
|
||||
]
|
||||
@@ -18,7 +18,7 @@ class Project(BaseModelViewPage):
|
||||
)
|
||||
|
||||
def get_services(self):
|
||||
services = self.services.filter(enable=True).order_by('order')
|
||||
services = self.services.filter(enabled=True).order_by('order')
|
||||
return services
|
||||
|
||||
class Meta:
|
||||
|
||||
@@ -7,7 +7,6 @@ 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):
|
||||
@@ -63,6 +62,7 @@ class Section(BaseModelViewPage):
|
||||
|
||||
|
||||
def get_projects(self):
|
||||
from PortfolioApp.models import Project
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user