コード例 #1
0
class FulfilmentSchema(BaseSchema):
    person = ExistingPersonValidator()
    type = FulfilmentTypeValidator(not_empty=True)
    status = FulfilmentStatusValidator(not_empty=True)
    chained_validators = [
        FulfilmentTypeStatusValidator(type='type', status='status')
    ]
コード例 #2
0
class RegoRoomSchema(BaseSchema):
    rego = ExistingRegistrationValidator(not_empty=True)
    room = validators.String(not_empty=True)
    by = ExistingPersonValidator(not_empty=True)
コード例 #3
0
class VoucherSchema(BaseSchema):
    count = validators.Int(min=1, max=100)
    leader = ExistingPersonValidator(not_empty=True)
    code = validators.String()
    comment = validators.String(not_empty=True)
コード例 #4
0
class FulfilmentGroupSchema(BaseSchema):
    person = ExistingPersonValidator(not_empty=False)
    code = validators.String(not_empty=True)
コード例 #5
0
class InvoiceSchema(BaseSchema):
    person = ExistingPersonValidator(not_empty=True)
    due_date = validators.DateConverter(month_style='dd/mm/yyyy')
    items = ForEach(InvoiceItemValidator())

    item_count = validators.Int(min=0) # no max, doesn't hit database
コード例 #6
0
class RegoNoteSchema(BaseSchema):
    rego = ExistingRegistrationValidator(not_empty=True)
    note = validators.String(not_empty=True)
    block = validators.Bool(if_empty=False)
    by = ExistingPersonValidator(not_empty=True)