コード例 #1
0
class ProductTaskLine(colander.MappingSchema):
    """
        A single estimation line
    """
    id = colander.SchemaNode(colander.Integer(),
                             widget=deform.widget.HiddenWidget(),
                             missing=u"",
                             css_class="span0")
    description = colander.SchemaNode(colander.String(),
                                      widget=DisabledInput(),
                                      missing=u'',
                                      css_class='col-md-3')
    tva = colander.SchemaNode(AmountType(),
                              widget=DisabledInput(),
                              css_class='col-md-1',
                              title=u'TVA')
    product_id = colander.SchemaNode(colander.Integer(),
                                     widget=deferred_product_widget,
                                     validator=deferred_product_validator,
                                     missing="",
                                     css_class="col-md-2",
                                     title=u"Code produit")
コード例 #2
0
ファイル: csv_import.py プロジェクト: tonthon/autonomie
class AssociationEntry(colander.MappingSchema):
    """
    A form entry for csv field <-> model's attribute association
    """
    csv_field = colander.SchemaNode(
        colander.String(),
        title=u"Libellé dans le fichier",
        widget=DisabledInput(),
    )
    model_attribute = colander.SchemaNode(
        colander.String(),
        title=u"Sera importé comme",
        widget=deferred_model_attribute_list_schema,
        missing=colander.drop,
    )
コード例 #3
0
def get_requirement_admin_schema():
    schema = get_sequence_model_admin(
        CompetenceOption,
        excludes=('children', ),
    )
    import colander
    from deform_extensions import DisabledInput
    schema['datas']['data']['requirements']['requirements'].add_before(
        'requirement',
        colander.SchemaNode(
            colander.String(),
            widget=DisabledInput(),
            name='deadline_label',
            title=u"Échéance",
        ))
    return schema