from .models import *
from django.utils.translation import gettext as _

def get_sections():

    sections = Section.objects.filter(enable=True).order_by('order')
    return sections

def get_section_views_Dict(section):

    services = section.rel_services_for_section.filter(enable=True).order_by('order')

    services_view_scheme = None
    if services:
        services_view_scheme = '2_cols_wo_group'
        for service in services:
            if service.rel_children_for_service.filter(enable=True):
                services_view_scheme = '3_cols_w_group'
                break


    Dict = {
        'sections': get_sections(),
        'services': services,
        'services_view_scheme': services_view_scheme,
    }

    return Dict