当前位置: 首页>>代码示例>>Python>>正文


Python Article.get_article_for_day_with_slug方法代码示例

本文整理汇总了Python中models.Article.get_article_for_day_with_slug方法的典型用法代码示例。如果您正苦于以下问题:Python Article.get_article_for_day_with_slug方法的具体用法?Python Article.get_article_for_day_with_slug怎么用?Python Article.get_article_for_day_with_slug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Article的用法示例。


在下文中一共展示了Article.get_article_for_day_with_slug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from models import Article [as 别名]
# 或者: from models.Article import get_article_for_day_with_slug [as 别名]
    def get(self, year, month, day, slug_title):
        year = dec(year)
        month = dec(month)
        day = dec(day)
        today = datetime.utcnow()
        articles = [Article.get_article_for_day_with_slug(year, month, day, slug_title)]
        logging.info(articles)
        response = render_template('blog.html',
            year_list=models.BLOG_YEAR_LIST,
            month_list=models.MONTH_LIST,
            current_year=today.year,
            current_month=today.month,
            articles=articles,
            show_comments=True)
        self.response.out.write(response)

        """auth_level = self.is_user_authorized()
开发者ID:spaceone,项目名称:mils-secure,代码行数:19,代码来源:handlers.py

示例2: get

# 需要导入模块: from models import Article [as 别名]
# 或者: from models.Article import get_article_for_day_with_slug [as 别名]
 def get(self, year, month, day, slug_title):
     auth_level = self.is_user_authorized()
     if auth_level == models.AUTH_LEVEL_REGISTERED_USER:
         self.redirect("/account/activate/reminder/")
     elif auth_level == models.AUTH_LEVEL_ACTIVATED_USER:
         year = dec(year)
         month = dec(month)
         day = dec(day)
         today = datetime.utcnow()
         articles = [Article.get_article_for_day_with_slug(year, month, day, slug_title)]
         logging.info(articles)
         response = render_template(
             "blog.html",
             year_list=models.BLOG_YEAR_LIST,
             month_list=models.MONTH_LIST,
             current_year=today.year,
             current_month=today.month,
             articles=articles,
         )
         self.response.out.write(response)
     else:
         response = render_template("index.html")
         self.response.out.write(response)
开发者ID:atulg,项目名称:mils-secure,代码行数:25,代码来源:www.py


注:本文中的models.Article.get_article_for_day_with_slug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。