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.contrib.auth.models import User
7 from django.utils.translation import ugettext_lazy as _
9 class Suggestion(models.Model):
10 author = models.CharField(_('author'), blank=True, max_length=120)
11 email = models.EmailField(_('e-mail'), blank=True)
12 title = models.CharField(_('title'), max_length=120)
13 description = models.TextField(_('description'), blank=True)
14 created_at = models.DateTimeField(_('creation date'), auto_now=True)
15 ip = models.IPAddressField(_('IP address'))
16 user = models.ForeignKey(User, blank=True, null=True)
19 ordering = ('-created_at',)
20 verbose_name = _('suggestion')
21 verbose_name_plural = _('suggestions')
23 def __unicode__(self):