# Path: aldryn_blog/models.py
# class Post(models.Model):
# 
#     title = models.CharField(_('Title'), max_length=255)
#     slug = models.SlugField(
#         verbose_name=_('Slug'),
#         max_length=255,
#         unique=True,
#         blank=True,
#         help_text=_('Used in the URL. If changed, the URL will change. Clean it to have it re-created.')
#     )
#     language = models.CharField(
#         verbose_name=_('language'),
#         max_length=5,
#         null=True,
#         blank=True,
#         choices=settings.LANGUAGES,
#         help_text=_('leave empty to display in all languages')
#     )
#     key_visual = FilerImageField(verbose_name=_('Key Visual'), blank=True, null=True)
#     lead_in = HTMLField(
#         verbose_name=_('Lead-in'),
#         help_text=_('Will be displayed in lists, and at the start of the detail page (in bold)')
#     )
#     content = PlaceholderField('aldryn_blog_post_content', related_name='aldryn_blog_posts')
#     author = models.ForeignKey(to=AUTH_USER_MODEL, verbose_name=_('Author'))
#     coauthors = models.ManyToManyField(
#         to=AUTH_USER_MODEL,
#         verbose_name=_('Co-Authors'),
#         null=True,
#         blank=True,
#         related_name='aldryn_blog_coauthors'
#     )
#     publication_start = models.DateTimeField(
#         verbose_name=_('Published Since'),
#         default=timezone.now,
#         help_text=_('Used in the URL. If changed, the URL will change.')
#     )
#     publication_end = models.DateTimeField(
#         verbose_name=_('Published Until'),
#         null=True,
#         blank=True
#     )
#     category = models.ForeignKey(
#         to=Category,
#         verbose_name=_('Category'),
#         null=True,
#         blank=True
#     )
# 
#     objects = RelatedManager()
#     published = PublishedManager()
#     tags = TaggableManager(blank=True)
#     app_data = AppDataField()
# 
#     def __unicode__(self):
#         return self.title
# 
#     def get_absolute_url(self):
#         kwargs = {
#             'year': self.publication_start.year,
#             'month': self.publication_start.month,
#             'day': self.publication_start.day,
#             'slug': self.slug
#         }
# 
#         if self.language and not getattr(settings, 'ALDRYN_BLOG_SHOW_ALL_LANGUAGES', False):
#             with override(self.language):
#                 return reverse('aldryn_blog:post-detail', kwargs=kwargs)
#         return reverse('aldryn_blog:post-detail', kwargs=kwargs)
# 
#     class Meta:
#         ordering = ['-publication_start']
# 
#     def save(self, **kwargs):
#         if not self.slug:
#             self.slug = slugify(self.title)
#         return super(Post, self).save(**kwargs)
# 
#     def get_author_slug(self):
#         # FIXME: This is a potential performance hogger
#         return get_slug_for_user(self.author)


from django.contrib.sitemaps import Sitemap
from ..models import Post
# -*- coding: utf-8 -*-



class BlogSitemap(Sitemap):
    changefreq = "never"
    priority = 0.5

    def items(self):
        return Post.published.all()


# Path: aldryn_blog/models.py
# class Post(models.Model):
# 
#     title = models.CharField(_('Title'), max_length=255)
#     slug = models.SlugField(
#         verbose_name=_('Slug'),
#         max_length=255,
#         unique=True,
#         blank=True,
#         help_text=_('Used in the URL. If changed, the URL will change. Clean it to have it re-created.')
#     )
#     language = models.CharField(
#         verbose_name=_('language'),
#         max_length=5,
#         null=True,
#         blank=True,
#         choices=settings.LANGUAGES,
#         help_text=_('leave empty to display in all languages')
#     )
#     key_visual = FilerImageField(verbose_name=_('Key Visual'), blank=True, null=True)
#     lead_in = HTMLField(
#         verbose_name=_('Lead-in'),
#         help_text=_('Will be displayed in lists, and at the start of the detail page (in bold)')
#     )
#     content = PlaceholderField('aldryn_blog_post_content', related_name='aldryn_blog_posts')
#     author = models.ForeignKey(to=AUTH_USER_MODEL, verbose_name=_('Author'))
#     coauthors = models.ManyToManyField(
#         to=AUTH_USER_MODEL,
#         verbose_name=_('Co-Authors'),
#         null=True,
#         blank=True,
#         related_name='aldryn_blog_coauthors'
#     )
#     publication_start = models.DateTimeField(
#         verbose_name=_('Published Since'),
#         default=timezone.now,
#         help_text=_('Used in the URL. If changed, the URL will change.')
#     )
#     publication_end = models.DateTimeField(
#         verbose_name=_('Published Until'),
#         null=True,
#         blank=True
#     )
#     category = models.ForeignKey(
#         to=Category,
#         verbose_name=_('Category'),
#         null=True,
#         blank=True
#     )
# 
#     objects = RelatedManager()
#     published = PublishedManager()
#     tags = TaggableManager(blank=True)
#     app_data = AppDataField()
# 
#     def __unicode__(self):
#         return self.title
# 
#     def get_absolute_url(self):
#         kwargs = {
#             'year': self.publication_start.year,
#             'month': self.publication_start.month,
#             'day': self.publication_start.day,
#             'slug': self.slug
#         }
# 
#         if self.language and not getattr(settings, 'ALDRYN_BLOG_SHOW_ALL_LANGUAGES', False):
#             with override(self.language):
#                 return reverse('aldryn_blog:post-detail', kwargs=kwargs)
#         return reverse('aldryn_blog:post-detail', kwargs=kwargs)
# 
#     class Meta:
#         ordering = ['-publication_start']
# 
#     def save(self, **kwargs):
#         if not self.slug:
#             self.slug = slugify(self.title)
#         return super(Post, self).save(**kwargs)
# 
#     def get_author_slug(self):
#         # FIXME: This is a potential performance hogger
#         return get_slug_for_user(self.author)


# Path: aldryn_blog/sitemaps/sitemap.py
from django.contrib.sitemaps import Sitemap
from ..models import Post

# -*- coding: utf-8 -*-



class BlogSitemap(Sitemap):
    changefreq = "never"
    priority = 0.5

    def items(self):
        return Post.published.all()


    def lastmod(self, obj):