# Path: submissions/constants.py
# YESNO = (
#     (1, _('Yes')),
#     (2, _('No')),
# )
# 
# YESNOMAYBE = (
#     (0, _('Maybe')),
#     (1, _('Yes')),
#     (2, _('No')),
# )
# 
# LANGUAGES = sorted(
#     (
#         (lang.alpha2, _(lang.name))
#         for lang in pycountry.languages
#         if hasattr(lang, 'alpha2')
#     ),
#     key=lambda x: x[1]
# )
# 
# SECTIONS = (
#     (1, _('Fiction')),
#     (2, _('Animation')),
#     (3, _('Documentary')),
#     (4, _('Experimental')),
# )
# 
# BACKLINKS = (
#     (1, _('festival website')),
#     (2, _('Facebook')),
#     (3, _('Twitter')),
#     (4, _('vk.com')),
#     (5, _('email')),
#     (6, _('internet search')),
#     (7, _('friends')),
#     (8, _('festivals database')),
#     (9, _('I participated in CPM\'2012')),
#     (10, _('place of study')),
#     (11, _('work')),
#     (12, _('other')),
# )


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from cpm_generic.constants import COUNTRIES
from submissions.constants import (YESNO, YESNOMAYBE, LANGUAGES, SECTIONS,
                                   BACKLINKS)



class Submission(models.Model):
    title = models.CharField(verbose_name=_('Original title'), max_length=1000)
    title_en = models.CharField(verbose_name=_('English title'),
                                max_length=1000)
    country = models.CharField(verbose_name=_('Country of production'),
                               max_length=2, choices=COUNTRIES)
    language = models.CharField(verbose_name=_('Language of original version'),
                                max_length=10, choices=LANGUAGES)
    genre = models.CharField(verbose_name=_('Genre'),
                             max_length=1000, blank=True, null=True)
    section = models.IntegerField(verbose_name=_('Section'),
                                  choices=SECTIONS)
    synopsis = models.TextField(verbose_name=_('Synopsis'))
    length = models.IntegerField(verbose_name=_('Runtime (in minutes)'))
    aspect_ratio = models.CharField(verbose_name=_('Aspect ratio'),
                                    max_length=1000)
    year = models.IntegerField(verbose_name=_('Year of production'))
    premiere = models.IntegerField(verbose_name=_('Premiere'), choices=YESNO)
    film_awards = models.TextField(verbose_name=_('Film awards'), blank=True)
    director_awards = models.TextField(
        verbose_name=_('Director awards'), blank=True)
    budget = models.CharField(verbose_name=_('Film budget'), max_length=1000)
    film_link = models.CharField(
        verbose_name=_('Link to download the film (optional)'),
        help_text=_(u'DVD, MPEG, MP4 or MOV'),
        max_length=1000, blank=True
    )

# Path: submissions/constants.py
# YESNO = (
#     (1, _('Yes')),
#     (2, _('No')),
# )
# 
# YESNOMAYBE = (
#     (0, _('Maybe')),
#     (1, _('Yes')),
#     (2, _('No')),
# )
# 
# LANGUAGES = sorted(
#     (
#         (lang.alpha2, _(lang.name))
#         for lang in pycountry.languages
#         if hasattr(lang, 'alpha2')
#     ),
#     key=lambda x: x[1]
# )
# 
# SECTIONS = (
#     (1, _('Fiction')),
#     (2, _('Animation')),
#     (3, _('Documentary')),
#     (4, _('Experimental')),
# )
# 
# BACKLINKS = (
#     (1, _('festival website')),
#     (2, _('Facebook')),
#     (3, _('Twitter')),
#     (4, _('vk.com')),
#     (5, _('email')),
#     (6, _('internet search')),
#     (7, _('friends')),
#     (8, _('festivals database')),
#     (9, _('I participated in CPM\'2012')),
#     (10, _('place of study')),
#     (11, _('work')),
#     (12, _('other')),
# )


# Path: submissions/models.py
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from cpm_generic.constants import COUNTRIES
from submissions.constants import (YESNO, YESNOMAYBE, LANGUAGES, SECTIONS,
                                   BACKLINKS)




class Submission(models.Model):
    title = models.CharField(verbose_name=_('Original title'), max_length=1000)
    title_en = models.CharField(verbose_name=_('English title'),
                                max_length=1000)
    country = models.CharField(verbose_name=_('Country of production'),
                               max_length=2, choices=COUNTRIES)
    language = models.CharField(verbose_name=_('Language of original version'),
                                max_length=10, choices=LANGUAGES)
    genre = models.CharField(verbose_name=_('Genre'),
                             max_length=1000, blank=True, null=True)
    section = models.IntegerField(verbose_name=_('Section'),
                                  choices=SECTIONS)
    synopsis = models.TextField(verbose_name=_('Synopsis'))
    length = models.IntegerField(verbose_name=_('Runtime (in minutes)'))
    aspect_ratio = models.CharField(verbose_name=_('Aspect ratio'),
                                    max_length=1000)
    year = models.IntegerField(verbose_name=_('Year of production'))
    premiere = models.IntegerField(verbose_name=_('Premiere'), choices=YESNO)
    film_awards = models.TextField(verbose_name=_('Film awards'), blank=True)
    director_awards = models.TextField(
        verbose_name=_('Director awards'), blank=True)
    budget = models.CharField(verbose_name=_('Film budget'), max_length=1000)
    film_link = models.CharField(
        verbose_name=_('Link to download the film (optional)'),
        help_text=_(u'DVD, MPEG, MP4 or MOV'),
        max_length=1000, blank=True
    )

    film_link_pwd = models.CharField(