<s> from django . contrib import admin <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . conf import settings <EOL> from djangobb_forum . models import Category , Forum , Topic , Post , Profile , Reputation , Report , Ban , Attachment , Poll , PollChoice , PostTracking <EOL> class BaseModelAdmin ( admin . ModelAdmin ) : <EOL> def get_actions ( self , request ) : <EOL> actions = super ( BaseModelAdmin , self ) . get_actions ( request ) <EOL> if '<STR_LIT>' in actions : <EOL> del actions [ '<STR_LIT>' ] <EOL> return actions <EOL> class CategoryAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT:name>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> class ForumAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT:name>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> class TopicAdmin ( BaseModelAdmin ) : <EOL> def subscribers2 ( self , obj ) : <EOL> return "<STR_LIT:U+002CU+0020>" . join ( [ user . username for user in obj . subscribers . all ( ) ] ) <EOL> subscribers2 . short_description = _ ( "<STR_LIT>" ) <EOL> list_display = [ '<STR_LIT:name>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> search_fields = [ '<STR_LIT:name>' ] <EOL> raw_id_fields = [ '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> class PostAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT>' , '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> search_fields = [ '<STR_LIT:body>' ] <EOL> raw_id_fields = [ '<STR_LIT>' , '<STR_LIT:user>' , '<STR_LIT>' ] <EOL> class ProfileAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT:user>' , '<STR_LIT:status>' , '<STR_LIT>' , '<STR_LIT:location>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT:user>' ] <EOL> class PostTrackingAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT:user>' ] <EOL> class ReputationAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:time>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> class ReportAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> list_filter = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def link_to_post ( self , instance ) : <EOL> return '<STR_LIT>' % { '<STR_LIT>' : instance . post . get_absolute_url ( ) , '<STR_LIT>' : instance . post . pk } <EOL> link_to_post . short_description = _ ( "<STR_LIT>" ) <EOL> link_to_post . allow_tags = True <EOL> def save_model ( self , request , obj , form , change ) : <EOL> if change and obj . zapped : <EOL> obj . zapped_by = request . user <EOL> obj . save ( ) <EOL> class BanAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> raw_id_fields = [ '<STR_LIT:user>' ] <EOL> class AttachmentAdmin ( BaseModelAdmin ) : <EOL> list_display = [ '<STR_LIT:id>' , '<STR_LIT:name>' , '<STR_LIT:size>' , '<STR_LIT:path>' , '<STR_LIT>' , ] <EOL> search_fields = [ '<STR_LIT:name>' ] <EOL> list_display_links = ( '<STR_LIT:name>' , ) <EOL> list_filter = ( "<STR_LIT>" , ) <EOL> class PollChoiceInline ( admin . TabularInline ) : <EOL> model = PollChoice <EOL> extra = <NUM_LIT:3> <EOL> class PollAdmin ( admin . ModelAdmin ) : <EOL> list_display = ( "<STR_LIT>" , "<STR_LIT>" , ) <EOL> list_display_links = ( "<STR_LIT>" , ) <EOL> list_editable = ( "<STR_LIT>" , ) <EOL> list_filter = ( "<STR_LIT>" , ) <EOL> inlines = [ PollChoiceInline ] <EOL> admin . site . register ( Category , CategoryAdmin ) <EOL> admin . site . register ( Forum , ForumAdmin ) <EOL> admin . site . register ( Topic , TopicAdmin ) <EOL> admin . site . register ( Post , PostAdmin ) <EOL> admin . site . register ( Profile , ProfileAdmin ) <EOL> admin . site . register ( PostTracking , PostTrackingAdmin ) <EOL> admin . site . register ( Reputation , ReputationAdmin ) <EOL> admin . site . register ( Report , ReportAdmin ) <EOL> admin . site . register ( Ban , BanAdmin ) <EOL> admin . site . register ( Attachment , AttachmentAdmin ) <EOL> admin . site . register ( Poll , PollAdmin ) </s>
