def _versions_for_tmpl(self, language=None):
        """
        generate a dictionary with info about all versions, suitable for
        use in a page template
        """
        versions = [tmpl_version(self, ver, str(n+1), language) for n, ver in
                    enumerate(self.all_versions(language))]
        versions = filter(lambda x: not x['removed'], versions)
        if versions:
            versions[-1]['is_current'] = True

        return versions
Exemple #2
0
    def _versions_for_tmpl(self, language=None):
        """
        generate a dictionary with info about all versions, suitable for
        use in a page template
        """
        versions = [tmpl_version(self, ver, str(n+1)) for n, ver in
                    enumerate(self.all_versions(language))]
        versions = filter(lambda x: not x['removed'], versions)
        if versions:
            versions[-1]['is_current'] = True

        return versions
    def _versions_for_tmpl(self, language):
        """ """
        hasKey = self._versions.has_key(language)
        if hasKey == True:
            _versions = self._versions[language]
            versions = [tmpl_version(self, ver, str(n+1))
                        for n, ver in enumerate(_versions)
                        if not ver.removed]
            if versions:
                versions[-1]['is_current'] = True

            return versions
        else:
            return None
    def _versions_for_tmpl(self, language):
        """ """
        hasKey = self._versions.has_key(language)
        if hasKey == True:
            _versions = self._versions[language]
            versions = [
                tmpl_version(self, ver, str(n + 1))
                for n, ver in enumerate(_versions) if not ver.removed
            ]
            if versions:
                versions[-1]['is_current'] = True

            return versions
        else:
            return None