ComponentImplementationClass, ConventionCounter, ExtendedParameter, \ EnvironmentType, ImplementationFieldDescription, ImplementationDescription, \ ImplementationRelationDescription, ImplementationRelationType, \ ImplementationComputedFieldDescription, ComponentInstanceField, \ ComponentInstanceRelation from ref.models.parameters import MageParam from ref.models.com import Link ################################################################################ ## Create admin site object ################################################################################ site = AdminSite() site.login_template = 'login.html' site.site_header = "Administration MAGE" site.site_title = 'MAGE' site.index_title = None site.register(Group, GroupAdmin) site.register(User, UserAdmin) ################################################################################ ## Parameters ################################################################################ class MageParamAdmin(ModelAdmin): list_display = [ 'app', 'key', 'value', 'model',
class ResourceManager(AdminSite): pass #or methods resource_manager = AdminSite(name="ResourceManager") class ResourceAdmin(admin.ModelAdmin): list_display = ["name", "type", "description"] search_fields = ["name", "type", "description"] resource_manager.register(Resource, ResourceAdmin) # Text to put at the end of each page's <title>. resource_manager.site_title = 'Site Admin' # Text to put in each page's <h1> (and above login form). resource_manager.site_header = 'Resources Manager' # Text to put at the top of the admin index page. resource_manager.index_title = 'Administration' #this is the subpage 'Manage Users' also only displayable to the admin class UserManager(AdminSite): pass #or methods user_manager = AdminSite(name="UserManager") class UserAdmin(admin.ModelAdmin):
EnvironmentType, ImplementationFieldDescription, ImplementationDescription, \ ImplementationRelationDescription, ImplementationRelationType, \ ImplementationComputedFieldDescription, ComponentInstanceField, \ ComponentInstanceRelation from ref.models.parameters import MageParam from ref.models.com import Link ################################################################################ ## Create admin site object ################################################################################ site = AdminSite() site.login_template = 'login.html' site.site_header = "Administration MAGE" site.site_title = 'MAGE' site.index_title = None site.register(Group, GroupAdmin) site.register(User, UserAdmin) ################################################################################ ## Parameters ################################################################################ class MageParamAdmin(ModelAdmin): list_display = ['app', 'key', 'value', 'model', 'axis1', 'description', ] search_fields = ['app', 'key', 'value', 'axis1', ] list_filter = ['app', ] #'model',] readonly_fields = ['default_value', ]