<s> from django import forms <EOL> from django . utils . functional import lazy <EOL> from . models import Field <EOL> from opps . core . forms import model_choices <EOL> class FieldAdminForm ( forms . ModelForm ) : <EOL> application = forms . ChoiceField ( choices = lazy ( model_choices , tuple ) ( ) ) <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( FieldAdminForm , self ) . __init__ ( * args , ** kwargs ) <EOL> instance = getattr ( self , '<STR_LIT>' , None ) <EOL> if instance and instance . pk : <EOL> self . fields [ '<STR_LIT>' ] . widget . attrs [ '<STR_LIT>' ] = True <EOL> class Meta : <EOL> model = Field </s>
