Python django.contrib.sitemaps.Sitemap() Examples

The following are 3 code examples of django.contrib.sitemaps.Sitemap(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.contrib.sitemaps , or try the search function .
Example #1
Source File: sitemap.py    From open-synthesis with GNU General Public License v3.0 5 votes vote down vote up
def items(self):
        """Return all the items for the Sitemap."""
        return Board.objects.public() 
Example #2
Source File: sitemap.py    From open-synthesis with GNU General Public License v3.0 5 votes vote down vote up
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)]) 
Example #3
Source File: sitemaps.py    From django-angularjs-blog with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def location(self, item):
        return r'/know/'


# class StaticViewSitemap(Sitemap):
    # priority = 0.5
    # changefreq = 'daily'
    #
    # def items(self):
    #     return ['code', 'me']
    #
    # def location(self, item):
    #     return reverse(item)