<s> """<STR_LIT>""" <EOL> from django . contrib import admin <EOL> from django . forms import Textarea <EOL> from django . db import models <EOL> from tethys_compute . models import Cluster , SettingsCategory , Setting , Scheduler , TethysJob <EOL> class SettingInline ( admin . TabularInline ) : <EOL> fields = ( '<STR_LIT:name>' , '<STR_LIT:content>' , '<STR_LIT>' ) <EOL> readonly_fields = ( '<STR_LIT:name>' , '<STR_LIT>' ) <EOL> model = Setting <EOL> extra = <NUM_LIT:0> <EOL> formfield_overrides = { <EOL> models . TextField : { '<STR_LIT>' : Textarea ( attrs = { '<STR_LIT>' : <NUM_LIT:2> , '<STR_LIT>' : <NUM_LIT> } ) } , <EOL> } <EOL> def has_delete_permission ( self , request , obj = None ) : <EOL> return False <EOL> def has_add_permission ( self , request ) : <EOL> return False <EOL> @ admin . register ( SettingsCategory ) <EOL> class SettingCategoryAdmin ( admin . ModelAdmin ) : <EOL> fields = ( '<STR_LIT:name>' , ) <EOL> readonly_fields = ( '<STR_LIT:name>' , ) <EOL> inlines = [ SettingInline ] <EOL> def has_delete_permission ( self , request , obj = None ) : <EOL> return False <EOL> def has_add_permission ( self , request ) : <EOL> return False <EOL> @ admin . register ( Cluster ) <EOL> class ClusterAdmin ( admin . ModelAdmin ) : <EOL> list_display = [ '<STR_LIT:name>' , '<STR_LIT:size>' , '<STR_LIT:status>' , '<STR_LIT>' ] <EOL> list_display_links = ( '<STR_LIT:name>' , '<STR_LIT:size>' ) <EOL> def get_form ( self , request , obj = None , ** kwargs ) : <EOL> self . fieldsets = [ <EOL> [ '<STR_LIT>' , { '<STR_LIT>' : [ ] } ] , <EOL> [ '<STR_LIT>' , { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , <EOL> ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) ] <EOL> } ] , <EOL> ] <EOL> fields = self . fieldsets [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] [ '<STR_LIT>' ] <EOL> advanced_options = self . fieldsets [ <NUM_LIT:1> ] [ <NUM_LIT:1> ] [ '<STR_LIT>' ] <EOL> if obj is None : <EOL> self . readonly_fields = [ '<STR_LIT>' ] <EOL> fields [ : ] = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> else : <EOL> self . readonly_fields = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> fields [ : ] = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> advanced_options . pop ( <NUM_LIT:1> ) <EOL> return super ( ClusterAdmin , self ) . get_form ( request , obj , ** kwargs ) <EOL> @ admin . register ( Scheduler ) <EOL> class SchedulerAdmin ( admin . ModelAdmin ) : <EOL> list_display = [ '<STR_LIT:name>' , '<STR_LIT:host>' , '<STR_LIT:username>' , '<STR_LIT:password>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> @ admin . register ( TethysJob ) <EOL> class JobAdmin ( admin . ModelAdmin ) : <EOL> list_display = [ '<STR_LIT:name>' , '<STR_LIT:description>' , '<STR_LIT:label>' , '<STR_LIT:user>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:status>' ] <EOL> list_display_links = ( '<STR_LIT:name>' , ) <EOL> def has_add_permission ( self , request ) : <EOL> return False </s>
