Python django.contrib.sitemaps.Sitemap() Examples

The following are 3 code examples for showing how to use django.contrib.sitemaps.Sitemap(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

You may also check out all available functions/classes of the module django.contrib.sitemaps , or try the search function .

Example 1
Project: open-synthesis   Author: twschiller   File: sitemap.py    License: 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
Project: open-synthesis   Author: twschiller   File: sitemap.py    License: 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
Project: django-angularjs-blog   Author: bluedazzle   File: sitemaps.py    License: 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)