Esempio n. 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=deform_extensions.DisabledInput(),
        missing=u'',
        css_class='col-md-3',
    )
    tva = colander.SchemaNode(
        AmountType(),
        widget=deform_extensions.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",
    )
Esempio n. 2
0
def deferred_edit_adminonly_widget(node, kw):
    """
        return a deferred adminonly edit widget
    """
    request = kw['request']
    if not request.has_permission('admin_company', request.context):
        return deform_extensions.DisabledInput()
    else:
        return deform.widget.TextInputWidget()
Esempio n. 3
0
def deferred_edit_adminonly_widget(node, kw):
    """
        return a deferred adminonly edit widget
    """
    request = kw['request']
    if request.user.is_contractor():
        return deform_extensions.DisabledInput()
    else:
        return deform.widget.TextInputWidget()
Esempio n. 4
0
class Attendance(colander.MappingSchema):
    account_id = forms.id_node()
    event_id = forms.id_node()

    username = colander.SchemaNode(
        colander.String(),
        title=u'',
        widget=deform_extensions.DisabledInput(),
        missing='',
        )

    status = colander.SchemaNode(
        colander.String(),
        widget=deform.widget.RadioChoiceWidget(values=ATTENDANCE_STATUS),
        validator=colander.OneOf([x[0] for x in ATTENDANCE_STATUS]),
        title=u'',
        missing=u'excused',
        )