from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from uuid_upload_path import upload_to
from text.models import Text

STATUS_CHOICES = (
    (1, _('New')),
    (2, _('Done')),
    (3, _('Double')),
    (4, _('Reject')),
    (5, _('In progress')),
)


class Author(models.Model):
    name = models.CharField(verbose_name=_('name'), max_length=200)
    about = models.TextField(verbose_name=_('about'), blank=True)
    user = models.ForeignKey(to=User, null=True, blank=True)


class Request(models.Model):
    user = models.ForeignKey(to=User)
    title = models.CharField(verbose_name=_('title'), max_length=200)
    url_to_source = models.CharField(verbose_name=_('url to source'), blank=True, max_length=200)
    text_source = models.TextField(verbose_name=_('text source'), blank=True)
    description = models.TextField(verbose_name=_('description'), blank=True)
    status = models.PositiveSmallIntegerField(_('status'), choices=STATUS_CHOICES, blank=True)
    text = models.ForeignKey(to=Text, blank=True, null=True)


class Sound(models.Model):
    text = models.ForeignKey(to=Text, verbose_name=_('text'))
    author = models.ForeignKey(to=Author, verbose_name=_('author'), related_name="texts")
    file = models.FileField(verbose_name=_('file'), upload_to=upload_to)
    created = models.DateTimeField(verbose_name=_('created'), auto_now_add=True)
    modified = models.DateTimeField(verbose_name=_('modified'), auto_now=True)
    request = models.ForeignKey(to=Request, blank=True, null=True)


@@ -544,24 +544,80 @@
 lank=True)%0A%0A
+    def __str__(self):%0A        return '%25s' %25 self.name%0A%0A
 %0Aclass Reque
@@ -1153,16 +1153,102 @@
 =True)%0A%0A
+    def __str__(self):%0A        return '%25s request from %25s' %25 (self.title, self.user)%0A%0A
 %0Aclass S
@@ -1700,28 +1700,112 @@
 st, blank=True, null=True)%0A%0A
+    def __str__(self):%0A        return '%25s sounded by %25s' %25 (self.text, self.author)%0A

def str