# Path: pages/models.py
# class MenuLink(models.Model):
#     """
#     Represents a link in the site navigation menu
#     """
#     caption = models.CharField(verbose_name=_('Caption'), max_length=200)
#     slug = models.SlugField(verbose_name=_('Slug'), max_length=200, unique=True)
#     page = models.ForeignKey(Page, verbose_name=_('Page'), blank=True, null=True,
#                              on_delete=models.CASCADE)
#     show_side_panel = models.BooleanField(verbose_name=_('Show side Panel'), default=False)
#     position = models.PositiveIntegerField(verbose_name=_('Position'), default=0, blank=False, null=False)
#     objects = MenuLinkQuerySet.as_manager()
# 
#     def get_absolute_url(self):
#         return reverse('pages:page', kwargs={'slug': self.slug})
# 
#     def __str__(self):
#         return self.caption
# 
#     class Meta:
#         verbose_name = _('Menu Link')
#         verbose_name_plural = _('Menu Links')
#         ordering = ('position',)


from django.contrib.sitemaps import Sitemap
from .models import MenuLink
# coding: utf-8
# Module: sitemap
# Created on: 30.12.2015
# Author: Roman Miroshnychenko aka Roman V.M.
# E-mail: romanvm@yandex.ua



class PagesSiteMap(Sitemap):
    changefreq = 'yearly'
    priority = 0.5

    def items(self):
        return MenuLink.objects.have_pages()


# Path: pages/models.py
# class MenuLink(models.Model):
#     """
#     Represents a link in the site navigation menu
#     """
#     caption = models.CharField(verbose_name=_('Caption'), max_length=200)
#     slug = models.SlugField(verbose_name=_('Slug'), max_length=200, unique=True)
#     page = models.ForeignKey(Page, verbose_name=_('Page'), blank=True, null=True,
#                              on_delete=models.CASCADE)
#     show_side_panel = models.BooleanField(verbose_name=_('Show side Panel'), default=False)
#     position = models.PositiveIntegerField(verbose_name=_('Position'), default=0, blank=False, null=False)
#     objects = MenuLinkQuerySet.as_manager()
# 
#     def get_absolute_url(self):
#         return reverse('pages:page', kwargs={'slug': self.slug})
# 
#     def __str__(self):
#         return self.caption
# 
#     class Meta:
#         verbose_name = _('Menu Link')
#         verbose_name_plural = _('Menu Links')
#         ordering = ('position',)


# Path: pages/sitemaps.py
from django.contrib.sitemaps import Sitemap
from .models import MenuLink

# coding: utf-8
# Module: sitemap
# Created on: 30.12.2015
# Author: Roman Miroshnychenko aka Roman V.M.
# E-mail: romanvm@yandex.ua



class PagesSiteMap(Sitemap):
    changefreq = 'yearly'
    priority = 0.5

    def items(self):
        return MenuLink.objects.have_pages()


    def lastmod(self, obj):