def get_all_posts_from_project(key): post_queries = Content.indexLookup("project_bin", key, bucket="spm_wallposts") posts = [] for post in post_queries.run(): posts.append(wall_post_to_display_json(post)) return sorted(posts, key=lambda x: x["pubdate"])[:50] # TODO: pagination? lol? delete old items? wut