<s> from django . contrib import admin <EOL> from django . db import models <EOL> from django . db . models import Count <EOL> from django . forms import Textarea <EOL> from premises . models import Contention , Premise , Report <EOL> class ReportAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class PremiseInline ( admin . TabularInline ) : <EOL> model = Premise <EOL> extra = <NUM_LIT:0> <EOL> fields = ( '<STR_LIT:user>' , '<STR_LIT>' , <EOL> '<STR_LIT:text>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> fk_name = "<STR_LIT>" <EOL> raw_id_fields = ( '<STR_LIT:user>' , ) <EOL> formfield_overrides = { <EOL> models . TextField : { <EOL> '<STR_LIT>' : Textarea ( <EOL> attrs = { '<STR_LIT>' : <NUM_LIT:2> , '<STR_LIT>' : <NUM_LIT> } <EOL> ) } , <EOL> } <EOL> class ContentionAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:title>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> list_editable = ( '<STR_LIT>' , '<STR_LIT>' , ) <EOL> search_fields = ( '<STR_LIT:title>' , '<STR_LIT>' ) <EOL> list_per_page = <NUM_LIT:100> <EOL> list_filter = ( '<STR_LIT>' , '<STR_LIT>' , ) <EOL> filter_horizontal = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> inlines = [ PremiseInline ] <EOL> def premise_count ( self , obj ) : <EOL> return obj . premises . count ( ) <EOL> class PremiseAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( '<STR_LIT:text>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> list_filter = ( '<STR_LIT>' , ) <EOL> def get_queryset ( self , request ) : <EOL> return Premise . objects . all_with_deleted ( ) <EOL> admin . site . register ( Report , ReportAdmin ) <EOL> admin . site . register ( Contention , ContentionAdmin ) <EOL> admin . site . register ( Premise , PremiseAdmin ) </s>
