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.GenericIPAddressField(_('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)
25 class PublishingSuggestion(models.Model):
26 contact = models.CharField(_('contact'), blank=True, max_length=120)
27 books = models.TextField(_('books'), null=True, blank=True)
28 audiobooks = models.TextField(_('audiobooks'), null=True, blank=True)
29 created_at = models.DateTimeField(_('creation date'), auto_now_add=True)
30 ip = models.GenericIPAddressField(_('IP address'))
31 user = models.ForeignKey(User, blank=True, null=True)
34 ordering = ('-created_at',)
35 verbose_name = _('publishing suggestion')
36 verbose_name_plural = _('publishing suggestions')
38 def __unicode__(self):
39 return unicode(self.created_at)