Beispiel #1
0
def _load_likes(user):
    return user_likes_paged.dump(as_page(Object.query
            .by_capability(Object.Capabilities.listed,
                           Object.Capabilities.listed_for_activity)
            .with_my_activities()
            .join(Like, Like.object_id == Object.id)
            .filter(Like.subject_id == user.id)
            .add_entity(Like)))
Beispiel #2
0
def _load_threads(user):
    query = CommentObject.query.filter(CommentObject.owner_id == current_user.id)
            # .filter_visible(CommentObject.)
    return comment_paged.dump(as_page(query, error_out=False)).data
Beispiel #3
0
def private_messages():
    return pm_paged.dump(as_page(current_user.private_messages,
                                 error_out=False)).data
Beispiel #4
0
def private_messages():
    return pm_paged.dump(
        as_page(current_user.private_messages, error_out=False)).data
Beispiel #5
0
def latest():
    query = Object.query.by_capability(
        'listed',
        aborting=False  # noqa
    ).with_my_activities().order_by(desc('objects.created_at'))
    return objects_paged.dump(as_page(query, error_out=False)).data
Beispiel #6
0
def latest():
    query = Object.query.by_capability('listed', aborting=False  # noqa
            ).with_my_activities(
            ).order_by(desc('objects.created_at'))
    return objects_paged.dump(as_page(query, error_out=False)).data