1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from django.db import models
5 from django.urls import reverse
6 from django.utils.translation import gettext_lazy as _
9 class InfoPage(models.Model):
10 """An InfoPage is used to display a two-column flatpage."""
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 verbose_name = _('info page')
19 verbose_name_plural = _('info pages')
24 def get_absolute_url(self):
25 return reverse('infopage', args=[self.slug])