# 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.template.base import Node, Library, TemplateSyntaxError
from statirator.pages.models import Page
from __future__ import absolute_import


register = Library()


class PagesNode(Node):
    """Pages list"""

    def __init__(self, language, asvar):
        self.language = language
        self.asvar = asvar

    def render(self, context):
        language = self.language.resolve(context)


# 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/templatetags/pages.py
from django.template.base import Node, Library, TemplateSyntaxError
from statirator.pages.models import Page

from __future__ import absolute_import


register = Library()


class PagesNode(Node):
    """Pages list"""

    def __init__(self, language, asvar):
        self.language = language
        self.asvar = asvar

    def render(self, context):
        language = self.language.resolve(context)


        pages = Page.objects.filter(language=language)