Python django.contrib.sitemaps 模块,Sitemap() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用django.contrib.sitemaps.Sitemap()

项目:open-synthesis    作者:twschiller    | 项目源码 | 文件源码
def items(self):
        """Return all the items for the Sitemap."""
        return Board.objects.all()
项目:open-synthesis    作者:twschiller    | 项目源码 | 文件源码
def lastmod(self, obj):  # pylint: disable=no-self-use
        """Return the last time the board or its content was structurally modified."""
        # NOTE: self parameter is required to match the Sitemap interface
        def _last_obj(class_):
            return max((o.submit_date for o in class_.objects.filter(board=obj)), default=obj.pub_date)
        return max([obj.pub_date, _last_obj(Evidence), _last_obj(Hypothesis)])