1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.db import models
6 from django.utils.translation import ugettext_lazy as _
8 class InfoPage(models.Model):
9 """An InfoPage is used to display a two-column flatpage."""
11 main_page = models.IntegerField(_('main page priority'), null=True, blank=True)
12 slug = models.SlugField(_('slug'), max_length=120, unique=True, db_index=True)
13 title = models.CharField(_('title'), max_length=120, blank=True)
14 left_column = models.TextField(_('left column'), blank=True)
15 right_column = models.TextField(_('right column'), blank=True)
18 ordering = ('main_page', 'slug',)
19 verbose_name = _('info page')
20 verbose_name_plural = _('info pages')
22 def __unicode__(self):
26 def get_absolute_url(self):
27 return ('infopage', [self.slug])