code: def get_posts(self, include_draft=False, filter_functions=None):
          def posts_generator(path):
              if os.path.isdir(path):
                  for file in os.listdir(path):
                      filename, ext = os.path.splitext(file)
                      format_name = get_standard_format_name(ext[1:])
                      if format_name is not None and re.match(
                              r'\d{4}-\d{2}-\d{2}-.+', filename):
                          post = Post()
                          post.format = format_name
                          post.meta, post.raw_content = FileStorage.read_file(
                              os.path.join(path, file))
                          post.rel_url = filename.replace('-', '/', 3) + '/'
                          post.unique_key = '/post/' + post.rel_url
                          yield post
          posts_path = os.path.join(current_app.instance_path, 'posts')
          result = filter(lambda p: include_draft or not p.is_draft,
                          posts_generator(posts_path))
          result = self._filter_result(result, filter_functions)
          return sorted(result, key=lambda p: p.created, reverse=True)