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 contact = models.CharField(_('contact'), blank=True, max_length=120)
11 description = models.TextField(_('description'), blank=True)
12 created_at = models.DateTimeField(_('creation date'), auto_now=True)
13 ip = models.IPAddressField(_('IP address'))
14 user = models.ForeignKey(User, blank=True, null=True)
17 ordering = ('-created_at',)
18 verbose_name = _('suggestion')
19 verbose_name_plural = _('suggestions')
21 def __unicode__(self):
22 return unicode(self.created_at)