Python django.contrib.sitemaps.Sitemap() Examples

The following are 3 code examples for showing how to use django.contrib.sitemaps.Sitemap(). These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.

You may also want to 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)