示例#1
0
class CreateWifiForm(BaseForm):
    country = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    internet_name = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    connection = fields.Integer(required=True)
    speed_download = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    speed_upload = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    information = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    prepayment = fields.Integer(required=True)
    price_day = fields.Integer(required=True)
    image_id = IdField()
    continent = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
示例#2
0
class CreateOrderForm(BaseForm):
    product_id = IdField(required=True)
    quantity = fields.Integer(required=True, validate=lambda value: value > 0)
    phone = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'],
                          required=True)
    name = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'],
                         required=True)
    email = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    address = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    product_type = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    description = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
示例#3
0
class UpdateProductForm(BaseUpdateForm):
    name = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    code = fields.String(validate=STRING_LENGTH_VALIDATORS['EX_SHORT'])

    price = fields.Integer()

    default_image_id = IdField()

    status = ProductStatusField()

    sizes = fields.List(ProductSizeField())

    promotion_package_id = IdField(allow_none=True)
示例#4
0
class CreateProductForm(BaseCreateForm):
    name = fields.String(required=True,
                         validate=STRING_LENGTH_VALIDATORS['LONG'])
    code = fields.String(validate=STRING_LENGTH_VALIDATORS['EX_SHORT'])

    price = fields.Integer()

    category_id = CategoryField(required=True)

    status = ProductStatusField()

    sizes = fields.List(ProductSizeField())

    promotion_package_id = IdField(allow_none=True)
示例#5
0
class CreatePromotionPackageForm(BaseCreateForm):
    name = fields.String(required=True,
                         validate=STRING_LENGTH_VALIDATORS['LONG'])
    sale_off_value = fields.Integer(required=True,
                                    validate=lambda value: 0 <= value <= 100)
示例#6
0
class BaseCreateProductForm(BaseForm):
    name = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    price = fields.Integer(required=True)
    category = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    image_id = IdField(required=True)
    country = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
示例#7
0
class CreateSimForm(BaseCreateProductForm):
    owned = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    day_used = fields.Integer(required=True)
示例#8
0
class CreateSimForm(BaseForm):
    owned = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    day_used = fields.Integer(required=True)
    price = fields.Integer(required=True)
    image_id = IdField()
    country = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])