def _user_has_account(self): blog = Database.find_one('blogs', {'author': self.user}) if blog is not None: self.user_blog = Blog.from_database(blog['id']) return True else: return False
def _view_blog(self): blog_to_see = input("Enter the ID of the blog you'd like to read: ") blog = Blog.from_database(blog_to_see) posts = blog.get_posts() for post in posts: print("Date: {}, title: {}\n\n{}".format(post['created_date'], post['title'], post['content']))