예제 #1
0
from flask_restful import reqparse

from kite.utils import validate_length

put_parser = reqparse.RequestParser()
put_parser.add_argument(
    "description",
    dest="descript",
    location="json",
    required=False,
    help="Type: String. The Topic's updated description.",
    type=validate_length(150, 10, "description"),
)

post_parser = reqparse.RequestParser()
post_parser.add_argument(
    "name",
    dest="name",
    location="json",
    required=True,
    help="Type: String. The new Topic's name, required.",
    type=validate_length(30, 3, "Name"),
)
post_parser.add_argument(
    "description",
    dest="descript",
    location="json",
    required=False,
    help="Type: String. The new Topic's description.",
    type=validate_length(150, 10, "description"),
)
예제 #2
0
from flask_restful import reqparse

from kite.utils import validate_length

post_parser = reqparse.RequestParser()
put_parser = reqparse.RequestParser()

post_parser.add_argument(
    "body",
    dest="body",
    location="json",
    required=True,
    help="Type: String. The reply's body, required. Length: 10-255 characters",
    type=validate_length(500, 10, "body"),
)
post_parser.add_argument(
    "author",
    dest="author",
    location="json",
    required=True,
    help="Type: String. The post's Author, required.",
)
post_parser.add_argument(
    "post_id",
    dest="post_id",
    location="json",
    required=True,
    help="Type: String. The post the reply belongs to, required.",
)

put_parser.add_argument(
예제 #3
0
from flask_restful import reqparse

from kite.utils import validate_length

post_parser = reqparse.RequestParser()
put_parser = reqparse.RequestParser()

post_parser.add_argument(
    "title",
    dest="title",
    location="json",
    required=True,
    help="Type: String. The post's title, required. Length: 5-30 characters",
    type=validate_length(50, 5, "title"),
)
post_parser.add_argument(
    "body",
    dest="body",
    location="json",
    required=True,
    help="Type: String. The post's body, required. Length: 10-250 characters",
    type=validate_length(1000, 10, "body"),
)
post_parser.add_argument(
    "topic",
    dest="topic_name",
    location="json",
    required=True,
    help=
    "Type: String. The Topic the post belongs to, required. Length: 5-30 characters",
)
예제 #4
0
from flask_restful import reqparse

from kite.utils import validate_length

post_parser = reqparse.RequestParser()

post_parser.add_argument(
    "username",
    dest="username",
    location="json",
    required=True,
    help="Type: String. The new user's username, required.",
    type=validate_length(30, 3, "username"),
)
post_parser.add_argument(
    "bio",
    dest="bio",
    location="json",
    required=False,
    help="Type: String. The new user's bio.",
    type=validate_length(100, 5, "bio"),
)
post_parser.add_argument(
    "password",
    dest="password",
    location="json",
    required=True,
    help="Type: String. The new user's password, required.",
    type=validate_length(55, 5, "password"),
)
post_parser.add_argument(