<s> from django . contrib import admin <EOL> from django import forms <EOL> from models import * <EOL> site = admin . AdminSite ( name = "<STR_LIT>" ) <EOL> class BookInline ( admin . TabularInline ) : <EOL> model = Author . books . through <EOL> class AuthorAdmin ( admin . ModelAdmin ) : <EOL> inlines = [ BookInline ] <EOL> class InnerInline ( admin . StackedInline ) : <EOL> model = Inner <EOL> can_delete = False <EOL> readonly_fields = ( '<STR_LIT>' , ) <EOL> class HolderAdmin ( admin . ModelAdmin ) : <EOL> class Media : <EOL> js = ( '<STR_LIT>' , ) <EOL> class InnerInline2 ( admin . StackedInline ) : <EOL> model = Inner2 <EOL> class Media : <EOL> js = ( '<STR_LIT>' , ) <EOL> class InnerInline3 ( admin . StackedInline ) : <EOL> model = Inner3 <EOL> class Media : <EOL> js = ( '<STR_LIT>' , ) <EOL> class TitleForm ( forms . ModelForm ) : <EOL> def clean ( self ) : <EOL> cleaned_data = self . cleaned_data <EOL> title1 = cleaned_data . get ( "<STR_LIT>" ) <EOL> title2 = cleaned_data . get ( "<STR_LIT>" ) <EOL> if title1 != title2 : <EOL> raise forms . ValidationError ( "<STR_LIT>" ) <EOL> return cleaned_data <EOL> class TitleInline ( admin . TabularInline ) : <EOL> model = Title <EOL> form = TitleForm <EOL> extra = <NUM_LIT:1> <EOL> class Inner4StackedInline ( admin . StackedInline ) : <EOL> model = Inner4Stacked <EOL> class Inner4TabularInline ( admin . TabularInline ) : <EOL> model = Inner4Tabular <EOL> class Holder4Admin ( admin . ModelAdmin ) : <EOL> inlines = [ Inner4StackedInline , Inner4TabularInline ] <EOL> class InlineWeakness ( admin . TabularInline ) : <EOL> model = ShoppingWeakness <EOL> extra = <NUM_LIT:1> <EOL> class QuestionInline ( admin . TabularInline ) : <EOL> model = Question <EOL> readonly_fields = [ '<STR_LIT>' ] <EOL> def call_me ( self , obj ) : <EOL> return '<STR_LIT>' <EOL> class PollAdmin ( admin . ModelAdmin ) : <EOL> inlines = [ QuestionInline ] <EOL> def call_me ( self , obj ) : <EOL> return '<STR_LIT>' <EOL> class ChapterInline ( admin . TabularInline ) : <EOL> model = Chapter <EOL> readonly_fields = [ '<STR_LIT>' ] <EOL> def call_me ( self , obj ) : <EOL> return '<STR_LIT>' <EOL> class NovelAdmin ( admin . ModelAdmin ) : <EOL> inlines = [ ChapterInline ] <EOL> class ConsigliereInline ( admin . TabularInline ) : <EOL> model = Consigliere <EOL> class SottoCapoInline ( admin . TabularInline ) : <EOL> model = SottoCapo <EOL> class ProfileInline ( admin . TabularInline ) : <EOL> model = Profile <EOL> extra = <NUM_LIT:1> <EOL> site . register ( TitleCollection , inlines = [ TitleInline ] ) <EOL> site . register ( Holder , HolderAdmin , inlines = [ InnerInline ] ) <EOL> site . register ( Holder2 , HolderAdmin , inlines = [ InnerInline2 ] ) <EOL> site . register ( Holder3 , inlines = [ InnerInline3 ] ) <EOL> site . register ( Poll , PollAdmin ) <EOL> site . register ( Novel , NovelAdmin ) <EOL> site . register ( Fashionista , inlines = [ InlineWeakness ] ) <EOL> site . register ( Holder4 , Holder4Admin ) <EOL> site . register ( Author , AuthorAdmin ) <EOL> site . register ( CapoFamiglia , inlines = [ ConsigliereInline , SottoCapoInline ] ) <EOL> site . register ( ProfileCollection , inlines = [ ProfileInline ] ) </s>
