<s> from __future__ import unicode_literals <EOL> from django . conf import settings <EOL> from django . db import models <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from filer . utils . compatibility import python_2_unicode_compatible <EOL> from . import filemodels <EOL> @ python_2_unicode_compatible <EOL> class Clipboard ( models . Model ) : <EOL> user = models . ForeignKey ( getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) , verbose_name = _ ( <EOL> '<STR_LIT:user>' ) , related_name = "<STR_LIT>" ) <EOL> files = models . ManyToManyField ( <EOL> '<STR_LIT>' , verbose_name = _ ( '<STR_LIT>' ) , related_name = "<STR_LIT>" , <EOL> through = '<STR_LIT>' ) <EOL> def append_file ( self , file_obj ) : <EOL> try : <EOL> self . files . get ( pk = file_obj . pk ) <EOL> return False <EOL> except filemodels . File . DoesNotExist : <EOL> newitem = ClipboardItem ( file = file_obj , clipboard = self ) <EOL> newitem . save ( ) <EOL> return True <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . id , self . user ) <EOL> class Meta : <EOL> app_label = '<STR_LIT>' <EOL> verbose_name = _ ( '<STR_LIT>' ) <EOL> verbose_name_plural = _ ( '<STR_LIT>' ) <EOL> class ClipboardItem ( models . Model ) : <EOL> file = models . ForeignKey ( '<STR_LIT>' , verbose_name = _ ( '<STR_LIT:file>' ) ) <EOL> clipboard = models . ForeignKey ( Clipboard , verbose_name = _ ( '<STR_LIT>' ) ) <EOL> class Meta : <EOL> app_label = '<STR_LIT>' <EOL> verbose_name = _ ( '<STR_LIT>' ) <EOL> verbose_name_plural = _ ( '<STR_LIT>' ) </s>
