<s> from django import forms <EOL> from django . forms import ModelForm , Form <EOL> from django . contrib . contenttypes . generic import generic_inlineformset_factory as inlineformset_factory <EOL> from contacts . models import Company , Person , Group , PhoneNumber , EmailAddress , InstantMessenger , WebSite , StreetAddress , SpecialDate <EOL> class CompanyCreateForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Company <EOL> fields = ( '<STR_LIT:name>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class CompanyUpdateForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Company <EOL> class PersonCreateForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Person <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:title>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class PersonUpdateForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Person <EOL> fields = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:title>' , '<STR_LIT>' ) <EOL> class GroupCreateForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Group <EOL> fields = ( '<STR_LIT:name>' , '<STR_LIT>' ) <EOL> class GroupUpdateForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Group <EOL> exclude = ( '<STR_LIT>' , ) <EOL> PhoneNumberFormSet = inlineformset_factory ( PhoneNumber , extra = <NUM_LIT:1> ) <EOL> EmailAddressFormSet = inlineformset_factory ( EmailAddress , extra = <NUM_LIT:1> ) <EOL> InstantMessengerFormSet = inlineformset_factory ( InstantMessenger , extra = <NUM_LIT:1> ) <EOL> WebSiteFormSet = inlineformset_factory ( WebSite , extra = <NUM_LIT:1> ) <EOL> StreetAddressFormSet = inlineformset_factory ( StreetAddress , extra = <NUM_LIT:1> ) <EOL> SpecialDateFormSet = inlineformset_factory ( SpecialDate , extra = <NUM_LIT:1> ) </s>
