예제 #1
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)
예제 #2
0
class ListProductForm(BaseListForm):
    search_text = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])

    categories = fields.List(IdField())

    statuses = fields.List(ProductStatusField())

    is_sale_off = fields.Boolean()
예제 #3
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'])
예제 #4
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'])
예제 #5
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)
예제 #6
0
class GetPostForm(BaseForm):
    id = IdField()
    slug = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
예제 #7
0
class CreatePostForm(BaseCreateForm):
    name = fields.String(required=True,
                         validate=STRING_LENGTH_VALIDATORS['LONG'])
    category_id = PostCategoryField(required=True)
    banner = IdField()
예제 #8
0
class UpdateBannerForm(BaseUpdateForm):
    name = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    object_id = IdField()
    object_type = fields.String(validate=STRING_LENGTH_VALIDATORS['EX_SHORT'])
예제 #9
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'])
예제 #10
0
class GetSimDetailForm(BaseForm):
    slug = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    id = IdField()
예제 #11
0
class UpdateCategoryForm(BaseUpdateForm):
    name = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])
    parent_id = IdField()
예제 #12
0
class GetSimForm(BaseForm):
    product_id = IdField(required=True)
예제 #13
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'])
예제 #14
0
class DeleteSimForm(BaseForm):
    id = IdField(required=True)
예제 #15
0
class ListCategoryForm(BaseListForm):
    name = fields.String(validate=STRING_LENGTH_VALIDATORS['LONG'])

    parent_id = IdField()

    get_parents = fields.Boolean()