예제 #1
0
class ToDoListOptions(Schema):
    project = fields.CoalesceField(
        [fields.Integer(), fields.Text()], default=None, required=False)
    tag = custom_fields.StringIdentifiedField(models.Tag,
                                              default=None,
                                              required=False)
    query = fields.Text(default='')
    all_tasks = fields.Bool(default=False)
    flat = fields.Bool(default=False)
    limit = fields.Integer(default=25)
    ignore_priority = fields.Bool(default=False)
    minimum_priority = fields.CoalesceField(
        [fields.Integer(), fields.Text()], default=None, required=False)
    state = fields.Enum(models.State,
                        soft_match=True,
                        required=False,
                        default=None)
    order_by = fields.List(
        fields.MultiChoiceField(
            {
                'created_at',
                'finished_at',
                'state',
                'priority',
                'project',
            },
            soft_match=True,
        ),
        required=False,
        default=None,
    )
예제 #2
0
class StatsOptionsSchema(Schema):
    project = fields.CoalesceField(
        [fields.Integer(), fields.Text()], default=None, required=False)
    tag = custom_fields.StringIdentifiedField(models.Tag,
                                              default=None,
                                              required=False)
    top_level_only = fields.Bool(default=True)
    ignore_priority = fields.Bool(default=False)
    minimum_priority = fields.CoalesceField(
        [fields.Integer(), fields.Text()], default=None, required=False)
    last_n_days = fields.Integer(default=128)
예제 #3
0
class PriorityCreateSchema(PrioritySchema):
    project = custom_fields.StringIdentifiedField(models.Project, default=None)
예제 #4
0
class CommentSchema(Schema):
    target = fields.CoalesceField([fields.Integer(), fields.Text()])
    project = custom_fields.StringIdentifiedField(models.Project, default=None)
    comment = fields.Text()
예제 #5
0
class TaggedSchema(Schema[models.Tagged]):
    todo_target = fields.CoalesceField([fields.Integer(), fields.Text()])
    tag_target = custom_fields.StringIdentifiedField(models.Tag)
    project = custom_fields.StringIdentifiedField(models.Project, default=None)
    recursive = fields.Bool(default=False, write_only=True)
예제 #6
0
class ModifyToDoSchema(Schema):
    target = fields.CoalesceField([fields.Integer(), fields.Text()])
    project = custom_fields.StringIdentifiedField(models.Project, default=None)
    description = fields.Text()
예제 #7
0
class ModifyPrioritySchema(Schema[models.Tagged]):
    todo = fields.CoalesceField([fields.Integer(), fields.Text()])
    project = custom_fields.StringIdentifiedField(models.Project, default=None)
    priority = fields.CoalesceField([fields.Integer(), fields.Text()])
    recursive = fields.Bool(default=False, write_only=True)
예제 #8
0
class UpdateDependencySchema(Schema):
    parent = custom_fields.StringIdentifiedField(
        models.ToDo, base_query_getter=lambda s: models.ToDo.active_todos(s))
    child = custom_fields.StringIdentifiedField(
        models.ToDo, base_query_getter=lambda s: models.ToDo.active_todos(s))