Commits

Mikhail Korobov committed 9de981c

Examples are changed

Comments (0)

Files changed (3)

admin_tools/dashboard/dashboards.py

         from admin_tools.dashboard import modules, Dashboard
 
         class MyDashboard(Dashboard):
+
+            # we want a 3 columns layout
+            columns = 3
+
             def __init__(self, **kwargs):
-                # we want a 3 columns layout
-                self.columns = 3
 
                 # append an app list module for "Applications"
                 self.children.append(modules.AppList(
         from admin_tools.dashboard import modules, AppIndexDashboard
 
         class MyAppIndexDashboard(AppIndexDashboard):
+
+            # we don't want a title, it's redundant
+            title = ''
+
             def __init__(self, app_title, models, **kwargs):
                 AppIndexDashboard.__init__(self, app_title, models, **kwargs)
-                # we don't want a title, it's redundant
-                self.title = ''
 
                 # append a model list module that lists all models
                 # for the app

admin_tools/dashboard/modules.py

             from admin_tools.dashboard import modules
 
             class HistoryDashboardModule(modules.LinkList):
+                title = 'History'
+
                 def init_with_context(self, context):
-                    self.title = 'History'
                     request = context['request']
                     # we use sessions to store the visited pages stack
                     history = request.session.get('history', [])

admin_tools/menu/items.py

             from admin_tools.menu.items import MenuItem
 
             class HistoryMenuItem(MenuItem):
+                title = 'History'
+
                 def init_with_context(self, context):
-                    self.title = 'History'
                     request = context['request']
                     # we use sessions to store the visited pages stack
                     history = request.session.get('history', [])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.