import six

from filters.schema import base_query_params_schema
from filters.validations import (
    CSVofIntegers,
    IntegerLike,
    DatetimeWithTZ
)

# make a validation schema for players filter query params
players_query_schema = base_query_params_schema.extend(
    {
        "id": IntegerLike(),
        "name": six.text_type,
        "team_id": CSVofIntegers(),  # /?team_id=1,2,3
        "install_ts": DatetimeWithTZ(),
        "update_ts": DatetimeWithTZ(),
    }
)

teams_query_schema = base_query_params_schema.extend(
    {
        "id": IntegerLike(),
        "name": six.text_type,
        "player_id": CSVofIntegers(),  # /?player_id=1,2,3
        "install_ts": DatetimeWithTZ(),
        "update_ts": DatetimeWithTZ(),
    }
)
示例#2
0
import six

from filters.schema import base_query_params_schema
from filters.validations import (
    IntegerLike,
    DatetimeWithTZ
)

# make a validation schema for event filter query params
event_query_schema = base_query_params_schema.extend(
    {
        "name": six.text_type,  # Depends on python version
        "start": DatetimeWithTZ(),
        "org_id": six.text_type,  # Depends on python version
        "cost": IntegerLike(),
    }
)
示例#3
0
import six

from filters.schema import base_query_params_schema
from filters.validations import (
    CSVofIntegers,
    IntegerLike,
    DatetimeWithTZ
)

# make a validation schema for players filter query params
recipe_query_schema = base_query_params_schema.extend(
    {
        # "owner": six.text_type,
        # "title": six.text_type,  # Depends on python version
        # "description": six.text_type,  # Depends on python version
        # "created": DatetimeWithTZ(),
    }
)
示例#4
0
import six

from filters.schema import base_query_params_schema
from filters.validations import (CSVofIntegers, IntegerLike)

# make a validation schema for issues filter query params
issue_query_schema = base_query_params_schema.extend({
    "id":
    IntegerLike(),
    "message":
    six.text_type,
    "categories":
    CSVofIntegers(),
})
示例#5
0
import six

from filters.schema import base_query_params_schema
from filters.validations import CSVofIntegers, IntegerLike

# make a validation schema for matriculas filter query params
matriculas_query_schema = base_query_params_schema.extend({
    "id":
    IntegerLike(),
    "curso":
    CSVofIntegers(),  # /?curso=1,2,3
    "aluno":
    CSVofIntegers(),  # /?aluno=1,2,3
    "turma":
    CSVofIntegers(),  # /?turma=1,2,3
})

alunos_query_schema = base_query_params_schema.extend({
    "id": IntegerLike(),
    "nome": six.text_type,
    "cpf": six.text_type,
})
示例#6
0
# bulid by Bean_Wei/ 2018/3/20 11:23
import six

from filters.schema import base_query_params_schema
from filters.validations import CSVofIntegers, IntegerLike, DatetimeWithTZ

post_query_schema = base_query_params_schema.extend({
    "title":
    six.text_type,
    "content":
    six.text_type,
    "slug":
    six.text_type,
    "timestamp":
    DatetimeWithTZ(),
    "tags":
    six.text_type,
    "category":
    six.text_type,
    "read_num":
    IntegerLike(),
    "own":
    CSVofIntegers(),
    "published":
    CSVofIntegers(),
})
import six
from filters.schema import base_query_params_schema
from filters.validations import IntegerLike


pessoa_query_schema = base_query_params_schema.extend(
    {
        'nome': six.text_type,
        'cpf': six.text_type,
    }
)
示例#8
0
import six

from filters.schema import base_query_params_schema
from filters.validations import (
    CSVofIntegers,
    IntegerLike,
    DatetimeWithTZ,
)

# make a validation schema for players filter query params
players_query_schema = base_query_params_schema.extend(
    {
        "id": IntegerLike(),
        "number": IntegerLike(),  # Depends on python version
        "order_date": DatetimeWithTZ(),  # /?team_id=1,2,3
        "price": DatetimeWithTZ(),
        "text": six.text_type,
        "account_id": IntegerLike(),

    }
)
示例#9
0
import six

from filters.schema import base_query_params_schema
from filters.validations import (CSVofIntegers, IntegerLike, DatetimeWithTZ)

# make a validation schema for players filter query params
players_query_schema = base_query_params_schema.extend({
    "id":
    IntegerLike(),
    "name":
    six.text_type,
    "team_id":
    CSVofIntegers(),  # /?team_id=1,2,3
    "install_ts":
    DatetimeWithTZ(),
    "update_ts":
    DatetimeWithTZ(),
})

teams_query_schema = base_query_params_schema.extend({
    "id":
    IntegerLike(),
    "name":
    six.text_type,
    "player_id":
    CSVofIntegers(),  # /?player_id=1,2,3
    "install_ts":
    DatetimeWithTZ(),
    "update_ts":
    DatetimeWithTZ(),
})
示例#10
0
import six

from filters.schema import base_query_params_schema
from filters.validations import (
    CSVofIntegers,
    IntegerLike,
    DatetimeWithTZ,    
)

user_query_schema = base_query_params_schema.extend(
    {
        "gender": six.text_type,
        "min_age": IntegerLike(),
        "max_age": IntegerLike(),
    }
)

clothes_query_schema = base_query_params_schema.extend(
    {
        "upper_category": six.text_type,
        "lower_category": six.text_type,
    }
)

clothes_set_query_schema = base_query_params_schema.extend(
    {
        "style": six.text_type,
    }
)

clothes_set_review_query_schema = base_query_params_schema.extend(