<s> from __future__ import unicode_literals <EOL> from django import forms <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from common . classes import ModelAttribute <EOL> from documents . models import Document <EOL> from . models import SmartLink , SmartLinkCondition <EOL> class SmartLinkForm ( forms . ModelForm ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( SmartLinkForm , self ) . __init__ ( * args , ** kwargs ) <EOL> self . fields [ '<STR_LIT>' ] . help_text = '<STR_LIT:U+0020>' . join ( <EOL> [ <EOL> unicode ( self . fields [ '<STR_LIT>' ] . help_text ) , <EOL> ModelAttribute . help_text_for ( <EOL> Document , type_names = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> ) <EOL> ] <EOL> ) <EOL> class Meta : <EOL> fields = ( '<STR_LIT:label>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> model = SmartLink <EOL> class SmartLinkConditionForm ( forms . ModelForm ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( SmartLinkConditionForm , self ) . __init__ ( * args , ** kwargs ) <EOL> self . fields [ '<STR_LIT>' ] = forms . ChoiceField ( <EOL> choices = ModelAttribute . get_choices_for ( <EOL> Document , type_names = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> ) , label = _ ( '<STR_LIT>' ) <EOL> ) <EOL> self . fields [ '<STR_LIT>' ] . help_text = '<STR_LIT:U+0020>' . join ( <EOL> [ <EOL> unicode ( self . fields [ '<STR_LIT>' ] . help_text ) , <EOL> ModelAttribute . help_text_for ( <EOL> Document , type_names = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> ) <EOL> ] <EOL> ) <EOL> class Meta : <EOL> model = SmartLinkCondition <EOL> exclude = ( '<STR_LIT>' , ) </s>
