<s> from future . builtins import str <EOL> from future . utils import python_2_unicode_compatible <EOL> from django . db import models <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from fluent_contents . extensions import PluginImageField , PluginUrlField <EOL> from fluent_contents . models . db import ContentItem <EOL> from . import appsettings <EOL> @ python_2_unicode_compatible <EOL> class PictureItem ( ContentItem ) : <EOL> """<STR_LIT>""" <EOL> ALIGN_LEFT = '<STR_LIT:left>' <EOL> ALIGN_CENTER = '<STR_LIT>' <EOL> ALIGN_RIGHT = '<STR_LIT:right>' <EOL> ALIGN_CHOICES = ( <EOL> ( ALIGN_LEFT , _ ( "<STR_LIT>" ) ) , <EOL> ( ALIGN_CENTER , _ ( "<STR_LIT>" ) ) , <EOL> ( ALIGN_RIGHT , _ ( "<STR_LIT>" ) ) , <EOL> ) <EOL> image = PluginImageField ( _ ( "<STR_LIT>" ) , upload_to = appsettings . FLUENT_PICTURE_UPLOAD_TO ) <EOL> caption = models . TextField ( _ ( "<STR_LIT>" ) , blank = True ) <EOL> align = models . CharField ( _ ( "<STR_LIT>" ) , max_length = <NUM_LIT:10> , choices = ALIGN_CHOICES , blank = True ) <EOL> url = PluginUrlField ( _ ( "<STR_LIT>" ) , blank = True ) <EOL> in_new_window = models . BooleanField ( _ ( "<STR_LIT>" ) , default = False , blank = True ) <EOL> class Meta : <EOL> verbose_name = _ ( "<STR_LIT>" ) <EOL> verbose_name_plural = _ ( "<STR_LIT>" ) <EOL> def __str__ ( self ) : <EOL> return self . caption or str ( self . image ) <EOL> @ property <EOL> def align_class ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . align == self . ALIGN_LEFT : <EOL> return '<STR_LIT>' <EOL> elif self . align == self . ALIGN_CENTER : <EOL> return '<STR_LIT>' <EOL> elif self . align == self . ALIGN_RIGHT : <EOL> return '<STR_LIT>' <EOL> else : <EOL> return '<STR_LIT>' </s>
