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, )
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)
class PriorityCreateSchema(PrioritySchema): project = custom_fields.StringIdentifiedField(models.Project, default=None)
class CommentSchema(Schema): target = fields.CoalesceField([fields.Integer(), fields.Text()]) project = custom_fields.StringIdentifiedField(models.Project, default=None) comment = fields.Text()
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)
class ModifyToDoSchema(Schema): target = fields.CoalesceField([fields.Integer(), fields.Text()]) project = custom_fields.StringIdentifiedField(models.Project, default=None) description = fields.Text()
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)
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))