# Path: pagelets/models.py
# class Page(PageletBase):
#     title = models.CharField(
#         _("title"),
#         max_length=255,
#         help_text=_(
#             "The page title.  To be displayed in the browser's title "
#             "bar as well as at the top of the page."
#         ),
#     )
#     slug = models.CharField(
#         _("slug"),
#         unique=True,
#         max_length=255,
#         help_text=_(
#             "A short string that uniquely identifies this page. "
#             "It's used in the page "
#             "URL, so don't change it unless you're positive nothing "
#             "links to this page. Valid url chars include "
#             "uppercase and lowercase letters, decimal digits, "
#             "hyphen, period, underscore, and tilde. "
#             "Do not include leading or trailing slashes."
#         ),
#         validators=[
#             validators.validate_url_chars,
#             validators.validate_leading_slash,
#             validators.validate_trailing_slash,
#         ],
#     )
#     description = models.TextField(
#         _("description"),
#         blank=True,
#         help_text=_(
#             "A description of the page for use in the meta tags and "
#             "teaser or other short excepts"
#         ),
#     )
#     base_template = models.CharField(
#         _("base template"),
#         max_length=255,
#         blank=True,
#         help_text=_(
#             "Specify an alternative layout template to use for this "
#             "page.  Clear the selection to use the default layout."
#         ),
#         default="pagelets/view_page.html",
#     )
#     meta_keywords = models.CharField(
#         _("meta keywords"),
#         max_length=200,
#         help_text=_("A comma delineated list of keywords"),
#         blank=True,
#     )
#     meta_robots = models.CharField(
#         _("meta Robots"),
#         max_length=20,
#         blank=True,
#         choices=[
#             ("FOLLOW, INDEX", "FOLLOW, INDEX"),
#             ("NOFOLLOW, NOINDEX", "NOFOLLOW, NOINDEX"),
#             ("FOLLOW, NOINDEX", "FOLLOW, NOINDEX"),
#             ("NOFOLLOW, INDEX", "NOFOLLOW, INDEX"),
#         ],
#     )
# 
#     tags = TaggableManager()
# 
#     def get_area_pagelets(self, area_slug, with_shared=True):
#         """
#         Combines and sorts the inline and shared pagelets for a given content
#         area.  Pagelets without an order are given 0, so they show up
#         in the middle.
#         """
#         pagelets = list(self.inline_pagelets.filter(area=area_slug))
#         if with_shared:
#             pagelets.extend(self.shared_pagelets.filter(area=area_slug))
#         pagelets.sort(key=lambda a: a.order or 0)
#         return pagelets
# 
#     def get_absolute_url(self):
#         return reverse("view_page", kwargs={"page_slug": self.slug})
# 
#     class Meta:
#         ordering = ("title",)
# 
#     def __str__(self):
#         return self.title


from django.contrib.sitemaps import GenericSitemap
from pagelets.models import Page



class PageSiteMap(GenericSitemap):
    def __init__(self, priority=None, changefreq=None):
        info_dict = {"queryset": Page.objects.all(), "date_field": "last_changed"}

# Path: pagelets/models.py
# class Page(PageletBase):
#     title = models.CharField(
#         _("title"),
#         max_length=255,
#         help_text=_(
#             "The page title.  To be displayed in the browser's title "
#             "bar as well as at the top of the page."
#         ),
#     )
#     slug = models.CharField(
#         _("slug"),
#         unique=True,
#         max_length=255,
#         help_text=_(
#             "A short string that uniquely identifies this page. "
#             "It's used in the page "
#             "URL, so don't change it unless you're positive nothing "
#             "links to this page. Valid url chars include "
#             "uppercase and lowercase letters, decimal digits, "
#             "hyphen, period, underscore, and tilde. "
#             "Do not include leading or trailing slashes."
#         ),
#         validators=[
#             validators.validate_url_chars,
#             validators.validate_leading_slash,
#             validators.validate_trailing_slash,
#         ],
#     )
#     description = models.TextField(
#         _("description"),
#         blank=True,
#         help_text=_(
#             "A description of the page for use in the meta tags and "
#             "teaser or other short excepts"
#         ),
#     )
#     base_template = models.CharField(
#         _("base template"),
#         max_length=255,
#         blank=True,
#         help_text=_(
#             "Specify an alternative layout template to use for this "
#             "page.  Clear the selection to use the default layout."
#         ),
#         default="pagelets/view_page.html",
#     )
#     meta_keywords = models.CharField(
#         _("meta keywords"),
#         max_length=200,
#         help_text=_("A comma delineated list of keywords"),
#         blank=True,
#     )
#     meta_robots = models.CharField(
#         _("meta Robots"),
#         max_length=20,
#         blank=True,
#         choices=[
#             ("FOLLOW, INDEX", "FOLLOW, INDEX"),
#             ("NOFOLLOW, NOINDEX", "NOFOLLOW, NOINDEX"),
#             ("FOLLOW, NOINDEX", "FOLLOW, NOINDEX"),
#             ("NOFOLLOW, INDEX", "NOFOLLOW, INDEX"),
#         ],
#     )
# 
#     tags = TaggableManager()
# 
#     def get_area_pagelets(self, area_slug, with_shared=True):
#         """
#         Combines and sorts the inline and shared pagelets for a given content
#         area.  Pagelets without an order are given 0, so they show up
#         in the middle.
#         """
#         pagelets = list(self.inline_pagelets.filter(area=area_slug))
#         if with_shared:
#             pagelets.extend(self.shared_pagelets.filter(area=area_slug))
#         pagelets.sort(key=lambda a: a.order or 0)
#         return pagelets
# 
#     def get_absolute_url(self):
#         return reverse("view_page", kwargs={"page_slug": self.slug})
# 
#     class Meta:
#         ordering = ("title",)
# 
#     def __str__(self):
#         return self.title


# Path: pagelets/sitemaps.py
from django.contrib.sitemaps import GenericSitemap
from pagelets.models import Page




class PageSiteMap(GenericSitemap):
    def __init__(self, priority=None, changefreq=None):
        info_dict = {"queryset": Page.objects.all(), "date_field": "last_changed"}

        super(PageSiteMap, self).__init__(info_dict, priority, changefreq)