# Path: modeladminutils/edit_handlers.py
# class AdminModelChooserPanel(object):
#     def __init__(self, field_name):
#         self.field_name = field_name
# 
#     def bind_to_model(self, model):
#         return type(
#             str('_AdminModelChooserPanel'),
#             (BaseAdminModelChooserPanel,),
#             {
#                 'model': model,
#                 'field_name': self.field_name,
#             }
#         )
# 
# Path: modeladminutils/models.py
# class BaseSearchableManager(models.Manager):
#     def get_queryset(self):
# 
# Path: cpm_generic/models.py
# class TranslatedField(object):
#     def __init__(self, en_field, be_field, ru_field):
#         self.en_field = en_field
#         self.be_field = be_field
#         self.ru_field = ru_field
# 
#     def __get__(self, instance, owner):
#         fields = {
#             'en': self.en_field,
#             'be': self.be_field,
#             'ru': self.ru_field,
#         }
#         field = fields.get(translation.get_language(), self.en_field)
#         return getattr(instance, field)


from django.db import models
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel
from wagtail.wagtailcore.models import Orderable  # TODO: is this good?
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailsearch import index
from modeladminutils.edit_handlers import AdminModelChooserPanel
from modeladminutils.models import SearchableManager
from cpm_generic.constants import COUNTRIES
from cpm_generic.models import TranslatedField
    title = TranslatedField('title_en', 'title_be', 'title_ru')

    director_en = models.CharField(max_length=1000, default='', blank=True)
    director_be = models.CharField(max_length=1000, default='', blank=True)
    director_ru = models.CharField(max_length=1000, default='', blank=True)
    director = TranslatedField('director_en', 'director_be', 'director_ru')

    country = models.CharField(max_length=2, choices=COUNTRIES,
                               null=True, blank=True)

    city_en = models.CharField(max_length=100, default='', blank=True)
    city_be = models.CharField(max_length=100, default='', blank=True)
    city_ru = models.CharField(max_length=100, default='', blank=True)
    city = TranslatedField('city_en', 'city_be', 'city_ru')

    year = models.IntegerField(null=True, blank=True)

    duration_en = models.CharField(max_length=100, default='', blank=True)
    duration_be = models.CharField(max_length=100, default='', blank=True)
    duration_ru = models.CharField(max_length=100, default='', blank=True)
    duration = TranslatedField('duration_en', 'duration_be', 'duration_ru')

    genre_en = models.CharField(max_length=1000, default='', blank=True)
    genre_be = models.CharField(max_length=1000, default='', blank=True)
    genre_ru = models.CharField(max_length=1000, default='', blank=True)
    genre = TranslatedField('genre_en', 'genre_be', 'genre_ru')

    synopsis_short_en = RichTextField(default='', blank=True)
    synopsis_short_be = RichTextField(default='', blank=True)
    synopsis_short_ru = RichTextField(default='', blank=True)

# Path: modeladminutils/edit_handlers.py
# class AdminModelChooserPanel(object):
#     def __init__(self, field_name):
#         self.field_name = field_name
# 
#     def bind_to_model(self, model):
#         return type(
#             str('_AdminModelChooserPanel'),
#             (BaseAdminModelChooserPanel,),
#             {
#                 'model': model,
#                 'field_name': self.field_name,
#             }
#         )
# 
# Path: modeladminutils/models.py
# class BaseSearchableManager(models.Manager):
#     def get_queryset(self):
# 
# Path: cpm_generic/models.py
# class TranslatedField(object):
#     def __init__(self, en_field, be_field, ru_field):
#         self.en_field = en_field
#         self.be_field = be_field
#         self.ru_field = ru_field
# 
#     def __get__(self, instance, owner):
#         fields = {
#             'en': self.en_field,
#             'be': self.be_field,
#             'ru': self.ru_field,
#         }
#         field = fields.get(translation.get_language(), self.en_field)
#         return getattr(instance, field)


# Path: cpm_data/models.py
from django.db import models
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel
from wagtail.wagtailcore.models import Orderable  # TODO: is this good?
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailsearch import index
from modeladminutils.edit_handlers import AdminModelChooserPanel
from modeladminutils.models import SearchableManager
from cpm_generic.constants import COUNTRIES
from cpm_generic.models import TranslatedField

    title = TranslatedField('title_en', 'title_be', 'title_ru')

    director_en = models.CharField(max_length=1000, default='', blank=True)
    director_be = models.CharField(max_length=1000, default='', blank=True)
    director_ru = models.CharField(max_length=1000, default='', blank=True)
    director = TranslatedField('director_en', 'director_be', 'director_ru')

    country = models.CharField(max_length=2, choices=COUNTRIES,
                               null=True, blank=True)

    city_en = models.CharField(max_length=100, default='', blank=True)
    city_be = models.CharField(max_length=100, default='', blank=True)
    city_ru = models.CharField(max_length=100, default='', blank=True)
    city = TranslatedField('city_en', 'city_be', 'city_ru')

    year = models.IntegerField(null=True, blank=True)

    duration_en = models.CharField(max_length=100, default='', blank=True)
    duration_be = models.CharField(max_length=100, default='', blank=True)
    duration_ru = models.CharField(max_length=100, default='', blank=True)
    duration = TranslatedField('duration_en', 'duration_be', 'duration_ru')

    genre_en = models.CharField(max_length=1000, default='', blank=True)
    genre_be = models.CharField(max_length=1000, default='', blank=True)
    genre_ru = models.CharField(max_length=1000, default='', blank=True)
    genre = TranslatedField('genre_en', 'genre_be', 'genre_ru')

    synopsis_short_en = RichTextField(default='', blank=True)
    synopsis_short_be = RichTextField(default='', blank=True)
    synopsis_short_ru = RichTextField(default='', blank=True)

    synopsis_short = TranslatedField('synopsis_short_en',