# Path: statirator/pages/models.py
# class Page(models.Model, TranslationsMixin):
#     """A multilingual page"""
# 
#     title = models.CharField(max_length=200)
#     slug = models.SlugField(max_length=200)
#     content = models.TextField()
#     language = models.CharField(max_length=5, choices=settings.LANGUAGES,
#                                 blank=True, default=settings.LANGUAGE_CODE)
#     page_type = models.CharField(max_length=5, choices=PAGE_TYPES)
#     description = models.CharField(max_length=255, blank=True, null=True)
# 
#     def __unicode__(self):
#         return self.title or self.slug
# 
#     @i18n_permalink
#     def get_absolute_url(self):
#         # index is a special case
#         if self.slug == 'index':
#             return ('pages_index', (), {})
# 
#         return ('pages_page', (), {'slug': self.slug})


from django.conf import settings
from django.utils.translation import activate
from django_medusa.renderers import StaticSiteRenderer
from .models import Page
from __future__ import absolute_import




class PagesRenderer(StaticSiteRenderer):

    def get_paths(self):

        paths = []

        for lang_code, lang_name in settings.LANGUAGES:
            activate(lang_code)

# Path: statirator/pages/models.py
# class Page(models.Model, TranslationsMixin):
#     """A multilingual page"""
# 
#     title = models.CharField(max_length=200)
#     slug = models.SlugField(max_length=200)
#     content = models.TextField()
#     language = models.CharField(max_length=5, choices=settings.LANGUAGES,
#                                 blank=True, default=settings.LANGUAGE_CODE)
#     page_type = models.CharField(max_length=5, choices=PAGE_TYPES)
#     description = models.CharField(max_length=255, blank=True, null=True)
# 
#     def __unicode__(self):
#         return self.title or self.slug
# 
#     @i18n_permalink
#     def get_absolute_url(self):
#         # index is a special case
#         if self.slug == 'index':
#             return ('pages_index', (), {})
# 
#         return ('pages_page', (), {'slug': self.slug})


# Path: statirator/pages/renderers.py
from django.conf import settings
from django.utils.translation import activate
from django_medusa.renderers import StaticSiteRenderer
from .models import Page

from __future__ import absolute_import




class PagesRenderer(StaticSiteRenderer):

    def get_paths(self):

        paths = []

        for lang_code, lang_name in settings.LANGUAGES:
            activate(lang_code)

            items = Page.objects.filter(language=lang_code)