コード例 #1
0
ファイル: workshop.py プロジェクト: w3bcr4ft/autonomie
def get_list_schema(company=False):
    """
    Return a schema for filtering workshop list
    """
    schema = lists.BaseListsSchema().clone()

    schema.insert(
        0,
        forms.today_node(
            name='date',
            default=colander.null,
            missing=colander.drop,
            description=u"Date de l'atelier",
            widget_options={'css_class': 'input-medium search-query'},
        ))

    if not company:
        schema.insert(
            0,
            user.user_node(missing=colander.drop,
                           name='participant_id',
                           widget_options={
                               'default_option':
                               ('', u"- Sélectionner un participant -"),
                           }))

    schema['search'].description = u"Intitulé de l'atelier"
    return schema
コード例 #2
0
ファイル: company.py プロジェクト: lluc/autonomie
def get_list_schema(company=False):
    """
    Return a schema for filtering companies list
    """
    schema = lists.BaseListsSchema().clone()
    schema.add(
        colander.SchemaNode(
            colander.Boolean(),
            name='active',
            label=u"Inclure les entreprises désactivées",
        ))
    return schema
コード例 #3
0
ファイル: company.py プロジェクト: Angry-Squirrels/autonomie
def get_list_schema(company=False):
    """
    Return a schema for filtering companies list
    """
    schema = lists.BaseListsSchema().clone()
    schema.add(
        colander.SchemaNode(colander.String(),
                            name='active',
                            missing="Y",
                            validator=colander.OneOf(('N', 'Y')),
                            widget=deform.widget.HiddenWidget()))
    return schema
コード例 #4
0
def get_list_schema(is_admin=False):
    schema = lists.BaseListsSchema().clone()

    schema.insert(
        0,
        colander.SchemaNode(colander.Integer(),
                            name='type_id',
                            widget=get_deferred_select_type(True),
                            validator=deferred_type_validator,
                            missing=colander.drop))

    schema.insert(
        0,
        colander.SchemaNode(
            colander.String(),
            name='status',
            widget=deform.widget.SelectWidget(values=STATUS_SEARCH),
            validator=colander.OneOf([s[0] for s in STATUS_SEARCH]),
            missing=colander.drop))

    schema.insert(
        0,
        colander.SchemaNode(
            colander.String(),
            name='user_status',
            widget=deform.widget.SelectWidget(values=ATTENDANCE_STATUS_SEARCH),
            validator=colander.OneOf([s[0] for s in ATTENDANCE_STATUS_SEARCH]),
            missing=colander.drop))

    if is_admin:
        schema.insert(
            0,
            user.user_node(missing=colander.drop,
                           name='participant_id',
                           widget_options={
                               'default_option':
                               ("", u"- Sélectionner un participant -"),
                           }))

        schema.insert(
            0,
            user.user_node(roles=['manager', 'admin'],
                           missing=colander.drop,
                           name='conseiller_id',
                           widget_options={
                               'default_option':
                               ("", u"- Sélectionner un conseiller -"),
                           }))

    del schema['search']
    return schema
コード例 #5
0
def get_list_schema(company=False):
    """
    Return a schema for filtering workshop list
    """
    schema = lists.BaseListsSchema().clone()

    schema.insert(
        0,
        forms.today_node(
            name='date',
            default=colander.null,
            missing=colander.drop,
            description=u"Date de l'atelier",
            widget_options={'css_class': 'input-medium search-query'},
        ))

    schema.insert(
        0,
        trainer_filter_node_factory(name='trainer_id'),
    )

    if not company:
        schema.insert(0,
                      participant_filter_node_factory(name='participant_id'))
        notfilled_node = colander.SchemaNode(
            colander.Boolean(),
            name='notfilled',
            title="",
            description=u"N'afficher que les ateliers non renseignés",
            missing=colander.drop,
        )
        schema.insert(1, notfilled_node)

    year = forms.year_select_node(
        name='year',
        query_func=get_invoice_years,
        widget_options={'default_val': (-1, u"Toutes les années")},
        missing=colander.null,
        description=u"Année")
    schema.insert(0, year)

    info_id_1 = colander.SchemaNode(
        colander.Integer(),
        name='info_1_id',
        missing=colander.drop,
        widget=deferred_filter_info1,
    )
    schema.insert(0, info_id_1)

    schema['search'].description = u"Intitulé de l'atelier"
    return schema
コード例 #6
0
ファイル: workshop.py プロジェクト: lluc/autonomie
def get_list_schema(company=False):
    """
    Return a schema for filtering workshop list
    """
    schema = lists.BaseListsSchema().clone()

    schema.insert(
        0,
        forms.today_node(
            name='date',
            default=colander.null,
            missing=colander.drop,
            description=u"Date de l'atelier",
            widget_options={'css_class': 'input-medium search-query'},
            ))

    if not company:
        schema.insert(0, user.user_node(
            missing=colander.drop,
            name='participant_id',
            widget_options={
                'default_option': ('', u"- Sélectionner un participant -"),
                }
        ))
        notfilled_node = colander.SchemaNode(
            colander.Boolean(),
            name='notfilled',
            title="",
            description=u"N'afficher que les ateliers non renseignés",
            missing=colander.drop,
        )
        schema.insert(1, notfilled_node)
    year = forms.year_select_node(get_invoice_years)
    year.name = 'year'
    schema.insert(0, year)

    schema['search'].description = u"Intitulé de l'atelier"
    return schema
コード例 #7
0
ファイル: activity.py プロジェクト: lluc/autonomie
def get_list_schema(is_admin=False):
    schema = lists.BaseListsSchema().clone()

    schema.insert(
        0,
        forms.today_node(
            name="date_range_end",
            default=colander.null,
            missing=colander.drop,
            description=u"Et le",
            widget_options={'css_class': 'input-medium search-query'},
        )
    )

    schema.insert(
        0,
        forms.today_node(
            name="date_range_start",
            default=colander.null,
            missing=colander.drop,
            description=u"Entre le",
            widget_options={'css_class': 'input-medium search-query'},
        )
    )

    schema.insert(0, colander.SchemaNode(
        colander.Integer(),
        name='type_id',
        widget=get_deferred_select_type(True),
        validator=deferred_type_validator,
        missing=colander.drop))

    schema.insert(0, colander.SchemaNode(
        colander.String(),
        name='status',
        widget=deform.widget.SelectWidget(values=STATUS_SEARCH),
        validator=colander.OneOf([s[0] for s in STATUS_SEARCH]),
        missing=colander.drop))

    schema.insert(0, colander.SchemaNode(
        colander.String(),
        name='user_status',
        widget=deform.widget.SelectWidget(values=ATTENDANCE_STATUS_SEARCH),
        validator=colander.OneOf([s[0] for s in ATTENDANCE_STATUS_SEARCH]),
        missing=colander.drop))

    if is_admin:
        schema.insert(0, user.user_node(
            missing=colander.drop,
            name='participant_id',
            widget_options={
                'default_option': ("", u"- Sélectionner un participant -"),
            }
            )
        )

        schema.insert(0, user.user_node(
            roles=['manager', 'admin'],
            missing=colander.drop,
            name='conseiller_id',
            widget_options={
                'default_option': ("", u"- Sélectionner un conseiller -"),
            }
            )
        )
    year = forms.year_select_node(get_invoice_years)
    year.name = 'year'
    schema.insert(0, year)

    del schema['search']
    return schema
コード例 #8
0
def get_list_schema(is_admin=False):
    schema = lists.BaseListsSchema().clone()

    schema.insert(
        0,
        forms.today_node(
            name="date_range_end",
            default=colander.null,
            missing=colander.drop,
            description=u"Et le",
            widget_options={'css_class': 'input-medium search-query'},
        ))

    schema.insert(
        0,
        forms.today_node(
            name="date_range_start",
            default=colander.null,
            missing=colander.drop,
            description=u"Entre le",
            widget_options={'css_class': 'input-medium search-query'},
        ))

    schema.insert(
        0,
        colander.SchemaNode(colander.Integer(),
                            name='type_id',
                            widget=get_deferred_select_type(True),
                            validator=deferred_type_validator,
                            missing=colander.drop))

    schema.insert(
        0,
        colander.SchemaNode(
            colander.String(),
            name='status',
            widget=deform.widget.SelectWidget(values=STATUS_SEARCH),
            validator=colander.OneOf([s[0] for s in STATUS_SEARCH]),
            missing=colander.drop))

    schema.insert(
        0,
        colander.SchemaNode(
            colander.String(),
            name='user_status',
            widget=deform.widget.SelectWidget(values=ATTENDANCE_STATUS_SEARCH),
            validator=colander.OneOf([s[0] for s in ATTENDANCE_STATUS_SEARCH]),
            missing=colander.drop))

    if is_admin:
        schema.insert(0,
                      participant_filter_node_factory(name='participant_id'))
        schema.insert(0, conseiller_filter_node_factory(name='conseiller_id'))

    year = forms.year_select_node(
        name='year',
        query_func=get_invoice_years,
        widget_options={'default_val': (-1, u"Toutes les années")},
        missing=colander.null,
        description=u"Année")
    schema.insert(0, year)

    del schema['search']
    return schema