Get all posts in their last version
420219
public function getAllLastVersion()
	{
		$qb = $this->createQueryBuilder('p');
		$qb->where('p.original IS NULL AND p.state=:state')
			->setParameter(':state', DocumentModel::STATE_PUBLISHED);
		
		$result = $qb->getQuery()->getResult();
		$return = array();
		foreach($result as $original) {
			$return[] = $this->getLastVersion($original->getId());
		}
		return $return;
	}
979196
function filterFolder(posts) {
      var reFolder = new RegExp(folder);
      return posts.filter(function filterPosts(post) {
        return reFolder.test(post.source.substr(0, post.source.lastIndexOf(path.sep)));
      });
    }
858930
public function getAllPosts()
    {
        $comm = new Comm();
        $comm->setDb($this->di->get("db"));

        $posts = ["-1" => "Välj en text..."];
        foreach ($comm->findAll() as $obj) {
            $posts[$obj->id] = "{$obj->title} ({$obj->id})";
        }

        return $posts;
    }
697954
def find_all(self, query):
        

        match = re.match(storage.BASE_BACKUP_REGEXP, query)

        if match is not None:
            for backup in iter(self):
                if backup.name == query:
                    yield backup
        elif query == 'LATEST':
            all_backups = list(iter(self))

            if not all_backups:
                return

            assert len(all_backups) > 0

            all_backups.sort(key=lambda bi: bi.last_modified)
            yield all_backups[-1]
        else:
            raise exception.UserException(
                msg='invalid backup query submitted',
                detail='The submitted query operator was "{0}."'
                .format(query))
73302
def last_post_on(self):
        
        dates = [n.last_post_on for n in self.children if n.last_post_on is not None]
        children_last_post_on = max(dates) if dates else None
        if children_last_post_on and self.obj.last_post_on:
            return max(self.obj.last_post_on, children_last_post_on)
        return children_last_post_on or self.obj.last_post_on
292209
def get_last_version(skip_tags=None) -> Optional[str]:
    

    debug('get_last_version skip_tags=', skip_tags)
    check_repo()
    skip_tags = skip_tags or []

    def version_finder(tag):
        if isinstance(tag.commit, TagObject):
            return tag.tag.tagged_date
        return tag.commit.committed_date

    for i in sorted(repo.tags, reverse=True, key=version_finder):
        if re.match(r'v\d+\.\d+\.\d+', i.name):
            if i.name in skip_tags:
                continue
            return i.name[1:]
    return None
1334325
def recent(self, with_catalog=True, with_date=True):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': 'Recent posts.',
            'with_catalog': with_catalog,
            'with_date': with_date,
        }
        self.render('list/post_list.html',
                    kwd=kwd,
                    view=MPost.query_recent(num=20),
                    postrecs=MPost.query_recent(num=2),
                    format_date=tools.format_date,
                    userinfo=self.userinfo,
                    cfg=CMS_CFG, )
281697
def get_versioned_files(cls):
        """"""
        output = run(['svn', 'st', '-vq', '--xml'], decode=False)
        tree = ET.XML(output)
        return sorted(entry.get('path') for entry in tree.findall('.//entry')
                      if cls.is_interesting(entry))
279725
function getTweets(T, user_id, max_tweets, finish) {
  return getTweetsIt(T, user_id, [], max_tweets, finish);
}
866029
def query_all(current_page_num=1):
        '''
        
        '''
        return TabLog.select().where(TabLog.user_id == 'None').order_by(TabLog.time_out.desc()).paginate(
            current_page_num, CMS_CFG['list_num']
        )
691320
def query_versions(self, version=None):
        """"""
        if version not in RELEASE_AND_CANDIDATE_LATEST_VERSIONS:
            return [version]

        url = urljoin(self.base_url, 'releases/')
        parser = self._create_directory_parser(url)
        if version:
            versions = parser.filter(RELEASE_AND_CANDIDATE_LATEST_VERSIONS[version])
            from distutils.version import LooseVersion
            versions.sort(key=LooseVersion)
            return [versions[-1]]
        else:
            return parser.entries
600108
def get_all(self, fields=list(), limit=None, order_by=list(), offset=None):
        """"""
        warnings.warn("get_all() is deprecated, please use get_multiple() instead", DeprecationWarning)
        return self.get_multiple(fields, limit, order_by, offset)
988325
def index():
    """"""
    posts = Post.query.order_by(Post.created.desc()).all()
    return render_template("blog/index.html", posts=posts)
873541
def get_versions_from_webpage(self):
        """"""
        res = requests.get('https://zenodo.org/record/'+self.data['conceptrecid'])
        soup = BeautifulSoup(res.text, 'html.parser')
        version_rows = soup.select('.well.metadata > table.table tr')
        if len(version_rows) == 0:  # when only 1 version
            return [{
                'recid': self.data['id'],
                'name': '1',
                'doi': self.data['doi'],
                'date': self.data['created'],
                'original_version': self.original_version()
            }]
        return [self._row_to_version(row) for row in version_rows if len(row.select('td')) > 1]
120068
public function posts()
    {
        $withTrashed = config('forum.preferences.display_trashed_posts') || Gate::allows('viewTrashedPosts');
        $query = $this->hasMany(Post::class);
        return $withTrashed ? $query->withTrashed() : $query;
    }
136765
def blog__get_posts(
      order: nil,
      language: nil,
      category_permalink: nil,
      category_permalink_AND: false,
      category_id: nil,
      category_id_AND: false,
      tag_permalink: nil,
      tag_permalink_AND: false,
      tag_id: nil,
      tag_id_AND: false,
      search: nil,
      page: nil,
      per_page: nil
    )
      posts = LatoBlog::Post.published.joins(:post_parent).where('lato_blog_post_parents.publication_datetime <= ?', DateTime.now)

      # apply filters
      order = order && order == 'ASC' ? 'ASC' : 'DESC'
      posts = _posts_filter_by_order(posts, order)
      posts = _posts_filter_by_language(posts, language)
      if category_permalink || category_id
        posts = posts.joins(:categories)
        posts = _posts_filter_by_category_permalink(posts, category_permalink, category_permalink_AND)
        posts = _posts_filter_category_id(posts, category_id, category_id_AND)
      end
      if tag_permalink || tag_id
        posts = posts.joins(:tags)
        posts = _posts_filter_by_tag_permalink(posts, tag_permalink, tag_permalink_AND)
        posts = _posts_filter_tag_id(posts, tag_id, tag_id_AND)
      end
      posts = _posts_filter_search(posts, search)

      # take posts uniqueness
      posts = posts.uniq(&:id)

      # save total posts
      total = posts.length

      # manage pagination
      page = page&.to_i || 1
      per_page = per_page&.to_i || 20
      posts = core__paginate_array(posts, per_page, page)

      # return result
      {
        posts: posts && !posts.empty? ? posts.map(&:serialize) : [],
        page: page,
        per_page: per_page,
        order: order,
        total: total
      }
    end
1019742
def version(self):
        
        return [x for x in self.session.query(models.Version).all()]