Beispiel #1
0
    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',
Beispiel #2
0
    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):
    list_display = ["username",
                    "last_name", 
                    "first_name", 
                    "email", 
                    "is_active", 
                    "is_staff", 
Beispiel #3
0
    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', ]

site.register(MageParam, MageParamAdmin)