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 _
10 class Suggestion(models.Model):
11 contact = models.CharField(_('contact'), blank=True, max_length=120)
12 description = models.TextField(_('description'), blank=True)
13 created_at = models.DateTimeField(_('creation date'), auto_now=True)
14 ip = models.GenericIPAddressField(_('IP address'))
15 user = models.ForeignKey(User, blank=True, null=True)
18 ordering = ('-created_at',)
19 verbose_name = _('suggestion')
20 verbose_name_plural = _('suggestions')
22 def __unicode__(self):
23 return unicode(self.created_at)
26 class PublishingSuggestion(models.Model):
27 contact = models.CharField(_('contact'), blank=True, max_length=120)
28 books = models.TextField(_('books'), null=True, blank=True)
29 audiobooks = models.TextField(_('audiobooks'), null=True, blank=True)
30 created_at = models.DateTimeField(_('creation date'), auto_now_add=True)
31 ip = models.GenericIPAddressField(_('IP address'))
32 user = models.ForeignKey(User, blank=True, null=True)
35 ordering = ('-created_at',)
36 verbose_name = _('publishing suggestion')
37 verbose_name_plural = _('publishing suggestions')
39 def __unicode__(self):
40 return unicode(self.created_at)