Пример #1
0
def get_preview_files_for_project(project_id, page=-1):
    """
    Return all preview files for given project.
    """
    query = (PreviewFile.query.join(Task).filter(
        Task.project_id == project_id).order_by(desc(PreviewFile.updated_at)))
    return query_utils.get_paginated_results(query, page)
Пример #2
0
def get_tasks_for_project(project_id, page=0):
    """
    Return all tasks for given project.
    """
    query = Task.query.filter(Task.project_id == project_id).order_by(
        Task.updated_at.desc())
    return query_utils.get_paginated_results(query, page, relations=True)
Пример #3
0
def get_comments_for_project(project_id, page=0):
    """
    Return all comments for given project.
    """
    query = (Comment.query.join(Task, Task.id == Comment.object_id).filter(
        Task.project_id == project_id).order_by(Comment.updated_at.desc()))
    return query_utils.get_paginated_results(query, page, relations=True)
Пример #4
0
def get_notifications_for_project(project_id, page=0):
    """
    Return all notifications for given project.
    """
    query = (Notification.query.join(Task).filter(
        Task.project_id == project_id).order_by(
            Notification.updated_at.desc()))
    return query_utils.get_paginated_results(query, page)
Пример #5
0
def get_playlists_for_project(project_id, page=0):
    """
    Return all time spents for given project.
    """
    query = Playlist.query.filter(Playlist.project_id == project_id)
    return query_utils.get_paginated_results(query, page, relations=True)
Пример #6
0
def get_time_spents_for_project(project_id, page=0):
    """
    Return all time spents for given project.
    """
    query = TimeSpent.query.join(Task).filter(Task.project_id == project_id)
    return query_utils.get_paginated_results(query, page)