コード例 #1
0
ファイル: views.py プロジェクト: dtekcth/DNollK.se
def index_from_year(request, year):
    """
    Shows the posts from the year specified in the year parameter.
    """
    posts = Post.published_posts_by_year(year)

    # Render paginated page
    return paginated_news_index(request, posts)
コード例 #2
0
ファイル: tests.py プロジェクト: dtekcth/DNollK.se
    def test_filter_on_date_range_works_as_expected(self):
        posts = Post.published_posts_by_year(2016)

        self.assertEqual(len(posts), 2)