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


Python Sitemap.get_urls方法代码示例

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


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

示例1: get_urls

# 需要导入模块: from django.contrib.sitemaps import Sitemap [as 别名]
# 或者: from django.contrib.sitemaps.Sitemap import get_urls [as 别名]
def get_urls(self, page=1, site=None, protocol=None):
        """
        This method is overridden so the appropriate `geo_format` attribute
        is placed on each URL element.
        """
        urls = Sitemap.get_urls(self, page=page, site=site, protocol=protocol)
        for url in urls:
            url['geo_format'] = self.geo_format
        return urls 
开发者ID:ComputerSocietyUNB,项目名称:CodingDojo,代码行数:11,代码来源:kml.py

示例2: get_urls

# 需要导入模块: from django.contrib.sitemaps import Sitemap [as 别名]
# 或者: from django.contrib.sitemaps.Sitemap import get_urls [as 别名]
def get_urls(self, page=1, site=None, protocol=None):
        """
        This method is overrridden so the appropriate `geo_format` attribute
        is placed on each URL element.
        """
        urls = Sitemap.get_urls(self, page=page, site=site, protocol=protocol)
        for url in urls:
            url['geo_format'] = self.geo_format
        return urls 
开发者ID:0daybug,项目名称:DjangoBlog,代码行数:11,代码来源:kml.py

示例3: get_urls

# 需要导入模块: from django.contrib.sitemaps import Sitemap [as 别名]
# 或者: from django.contrib.sitemaps.Sitemap import get_urls [as 别名]
def get_urls(self, page=1, site=None):
        """
        This method is overrridden so the appropriate `geo_format` attribute
        is placed on each URL element.
        """
        urls = Sitemap.get_urls(self, page=page, site=site)
        for url in urls: url['geo_format'] = 'georss'
        return urls 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:10,代码来源:georss.py

示例4: get_urls

# 需要导入模块: from django.contrib.sitemaps import Sitemap [as 别名]
# 或者: from django.contrib.sitemaps.Sitemap import get_urls [as 别名]
def get_urls(self, page=1, site=None):
        """
        This method is overrridden so the appropriate `geo_format` attribute
        is placed on each URL element.
        """
        urls = Sitemap.get_urls(self, page=page, site=site)
        for url in urls: url['geo_format'] = self.geo_format
        return urls 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:10,代码来源:kml.py

示例5: test_sitemap_get_urls_no_site_1

# 需要导入模块: from django.contrib.sitemaps import Sitemap [as 别名]
# 或者: from django.contrib.sitemaps.Sitemap import get_urls [as 别名]
def test_sitemap_get_urls_no_site_1(self):
        """
        Check we get ImproperlyConfigured if we don't pass a site object to
        Sitemap.get_urls and no Site objects exist
        """
        Site.objects.all().delete()
        self.assertRaises(ImproperlyConfigured, Sitemap().get_urls) 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:9,代码来源:test_http.py

示例6: test_sitemap_get_urls_no_site_2

# 需要导入模块: from django.contrib.sitemaps import Sitemap [as 别名]
# 或者: from django.contrib.sitemaps.Sitemap import get_urls [as 别名]
def test_sitemap_get_urls_no_site_2(self):
        """
        Check we get ImproperlyConfigured when we don't pass a site object to
        Sitemap.get_urls if Site objects exists, but the sites framework is not
        actually installed.
        """
        Site._meta.installed = False
        self.assertRaises(ImproperlyConfigured, Sitemap().get_urls) 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:10,代码来源:test_http.py

示例7: test_sitemap_item

# 需要导入模块: from django.contrib.sitemaps import Sitemap [as 别名]
# 或者: from django.contrib.sitemaps.Sitemap import get_urls [as 别名]
def test_sitemap_item(self):
        """
        Check to make sure that the raw item is included with each
        Sitemap.get_url() url result.
        """
        test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()})
        def is_testmodel(url):
            return isinstance(url['item'], TestModel)
        item_in_url_info = all(map(is_testmodel, test_sitemap.get_urls()))
        self.assertTrue(item_in_url_info) 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:12,代码来源:test_http.py


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