コード例 #1
0
ファイル: models.py プロジェクト: namongk/ecogwiki
    def get_titles(cls, user=None):
        email = user.email() if user is not None else u"None"
        titles = cache.get_titles(email)
        if titles is None:
            titles = set([page.title for page in cls.get_index(user)])
            cache.set_titles(email, titles)

        return titles
コード例 #2
0
ファイル: models.py プロジェクト: sangheestyle/ecogwiki
    def get_titles(cls, user=None):
        email = user.email() if user is not None else u'None'
        titles = cache.get_titles(email)
        if titles is not None:
            titles = json.loads(titles)
        else:
            titles = [page.title for page in cls.get_index(user)]
            cache.set_titles(email, json.dumps(titles))

        return titles