當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。