def dates(self):
        """returns the years and months for which there are posts"""
        if o_settings.CACHE_ENABLED:
            key = get_key('posts_dates')
            cached = cache.get(key)
            if cached:
                return cached

        posts = self.published()
        dates = OrderedDict()
        for post in posts:
            key = post.created.strftime('%Y_%m')
            try:
                dates[key][1] = dates[key][1] + 1
            except __HOLE__:
                dates[key] = [post.created, 1]

        if o_settings.CACHE_ENABLED:
            cache.set(key, dates, o_settings.CACHE_TIMEOUT)
        return dates
dataset/ETHPy150Open jamiecurle/django-omblog/omblog/managers.py/PostManager.dates