Commits

David Jean Louis committed c8c2dda

added some docstrings + fixed pyflakes warnings

Comments (0)

Files changed (16)

admin_tools/__init__.py

-VERSION = '0.1.2'
+"""
+django-admin-tools is a collection of extensions/tools for the default django 
+administration interface, it includes:
+
+ * a full featured and customizable dashboard,
+ * a customizable menu bar,
+ * tools to make admin theming easier.
+"""
+VERSION = '0.2.0'

admin_tools/dashboard/management/commands/customdashboard.py

-import os, shutil
-from optparse import make_option
-from django.core.management.base import BaseCommand, LabelCommand, CommandError
+import os
+from django.core.management.base import BaseCommand, CommandError
 from django.template.loader import render_to_string
 
 

admin_tools/dashboard/templatetags/admin_tools_dashboard_tags.py

 
 import math
 from django import template
-from django.conf import settings
 from admin_tools.utils import get_media_url
 from admin_tools.dashboard.utils import get_dashboard
 

admin_tools/dashboard/urls.py

-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import patterns, url
 
 urlpatterns = patterns('admin_tools.dashboard.views',
     url(r'^get_preferences/$', 'get_preferences', name='admin-tools-dashboard-get-preferences'),

admin_tools/dashboard/utils.py

 from django.conf import settings
 from django.contrib import admin
 from django.core.exceptions import ImproperlyConfigured
-from django.core.urlresolvers import reverse
-from django.http import HttpRequest
 from django.utils.importlib import import_module
 from django.utils.text import capfirst
 from admin_tools.dashboard import Registry
-from admin_tools.dashboard.models import *
 
 
 def get_dashboard(context, location):

admin_tools/dashboard/views.py

 from django.contrib.auth.decorators import login_required
-from django.http import HttpResponse, HttpResponseRedirect
-from django.shortcuts import get_object_or_404
-from django.utils import simplejson
+from django.http import HttpResponse
 from django.views.generic.simple import direct_to_template
 
 try:

admin_tools/menu/management/commands/custommenu.py

-import os, shutil
-from optparse import make_option
+import os
 from django.core.management.base import BaseCommand, CommandError
 from django.template.loader import render_to_string
 

admin_tools/menu/templatetags/admin_tools_menu_tags.py

 """
 
 from django import template
-from django.conf import settings
-from django.http import HttpRequest
 from admin_tools.utils import get_media_url
 from admin_tools.menu.models import Bookmark, BookmarkMenuItem
 from admin_tools.menu.utils import get_admin_menu

admin_tools/menu/urls.py

-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import patterns, url
 
 urlpatterns = patterns('admin_tools.menu.views',
     url(r'^add_bookmark/$', 'add_bookmark', name='admin-tools-menu-add-bookmark'),

admin_tools/menu/utils.py

 Menu utilities.
 """
 
-import urllib
 from django.conf import settings
 from django.core.exceptions import ImproperlyConfigured
 from django.utils.importlib import import_module

admin_tools/menu/views.py

 from django.contrib.auth.decorators import login_required
 from django.http import HttpResponse, HttpResponseRedirect
 from django.shortcuts import get_object_or_404
-from django.utils import simplejson
 from django.views.generic.simple import direct_to_template
 
 try:

admin_tools/models.py

-# Create your models here.

admin_tools/theming/models.py

-from django.db import models
-
-# Create your models here.

admin_tools/urls.py

-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import patterns, url, include
 
 urlpatterns = patterns('',
     url(r'^menu/', include('admin_tools.menu.urls')),

admin_tools/utils.py

 
 from django.conf import settings
 from django.core.urlresolvers import reverse
-from django.utils.text import capfirst
 
 class AppListElementMixin(object):
     """
     AppListMenuItem (to honor the DRY concept).
     """
     def _check_perms(self, request, model, model_admin):
+        """
+        Checks that the current user can view the given model in the admin.
+        """
         mod = '%s.%s' % (model.__module__, model.__name__)
 
         # check that the app is not in the exclude list
         return perms
 
     def _get_admin_change_url(self, model):
+        """
+        Returns the admin change url.
+        """
         app_label = model._meta.app_label
         return reverse('admin:%s_%s_changelist' % (app_label,
                                                    model.__name__.lower()))
 
     def _get_admin_add_url(self, model):
+        """
+        Returns the admin add url.
+        """
         app_label = model._meta.app_label
         return reverse('admin:%s_%s_add' % (app_label, model.__name__.lower()))
 

admin_tools/views.py

-# Create your views here.