2011-06-23 42 views

回答

0

的主要問題是,admin_tools_dashboard_preferences需要被截斷(幾乎每一個變化而到儀表板製成。)

而且代碼的第一個片段上documentation page甚至沒有爲我工作。我從文檔的其他部分摘錄了片段,他們似乎沒有任何問題。 最後,我的示例儀表板看起來像這樣。 請記住截斷您的偏好。

class MyDashboard(Dashboard): 

    columns = 3 

    def __init__(self, **kwargs): 
     Dashboard.__init__(self, **kwargs) 

     # will only list the django.contrib.auth models 
     self.children += [ 
      modules.ModelList('Authentication', ['django.contrib.auth.*',]) 
     ] 

     self.children.append(modules.Group(
      title="My group", 
      display="tabs", 
      children=[ 
       modules.AppList(
        title='Administration', 
        models=('django.contrib.*',) 
       ), 
       modules.AppList(
        title='Applications', 
        exclude=('django.contrib.*',) 
       ) 
      ] 
     )) 
     self.children.append(modules.LinkList(
      layout='inline', 
      children=(
       { 
        'title': 'Python website', 
        'url': 'http://www.python.org', 
        'external': True, 
        'description': 'Python programming language rocks !', 
       }, 
       ['Django website', 'http://www.djangoproject.com', True], 
       ['Some internal link', '/some/internal/link/'], 
      ) 
     ))