From: Stephen Burrows Date: Thu, 31 Mar 2011 19:36:30 +0000 (-0400) Subject: Updates to gilbert. Reorganizing imports and removing support for python < 2.5.4. X-Git-Url: http://git.ithinksw.org/philo.git/commitdiff_plain/3c26965045e8881acd4d5de8c195e4aa61b95ed1 Updates to gilbert. Reorganizing imports and removing support for python < 2.5.4. --- diff --git a/README b/README index 6e067ca..cae3cad 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ Prerequisites: * Python 2.5.4+ * Django 1.2+ * django-mptt e734079+ - * django-staticmedia 0.2+ + * (Optional) django-staticmedia 0.2+ * (Optional) django-grappelli 2.0+ * (Optional) south 0.7.2+ * (Optional) recaptcha-django r6 diff --git a/README.markdown b/README.markdown index ca9d00a..6ecadca 100644 --- a/README.markdown +++ b/README.markdown @@ -5,7 +5,7 @@ Prerequisites: * [Python 2.5.4+ <http://www.python.org>](http://www.python.org/) * [Django 1.2+ <http://www.djangoproject.com/>](http://www.djangoproject.com/) * [django-mptt e734079+ <https://github.com/django-mptt/django-mptt/>](https://github.com/django-mptt/django-mptt/) - * [django-staticmedia 0.2+ <http://pypi.python.org/pypi/django-staticmedia/>](http://pypi.python.org/pypi/django-staticmedia/) + * (Optional) [django-staticmedia 0.2+ <http://pypi.python.org/pypi/django-staticmedia/>](http://pypi.python.org/pypi/django-staticmedia/) * (Optional) [django-grappelli 2.0+ <http://code.google.com/p/django-grappelli/>](http://code.google.com/p/django-grappelli/) * (Optional) [south 0.7.2+ <http://south.aeracode.org/)](http://south.aeracode.org/) * (Optional) [recaptcha-django r6 <http://code.google.com/p/recaptcha-django/>](http://code.google.com/p/recaptcha-django/) diff --git a/contrib/gilbert/plugins/models.py b/contrib/gilbert/plugins/models.py index 5217df3..0ba310e 100644 --- a/contrib/gilbert/plugins/models.py +++ b/contrib/gilbert/plugins/models.py @@ -1,15 +1,15 @@ -import operator -from django.forms.models import ModelForm, modelform_factory +from django.conf import settings +from django.contrib.admin.util import lookup_field, label_for_field, display_for_field, NestedObjects +from django.core.exceptions import PermissionDenied from django.db.models import Q from django.db.models.fields.related import ManyToOneRel from django.db.models.fields.files import FieldFile, ImageFieldFile, FileField -from django.contrib.admin.util import lookup_field, label_for_field, display_for_field, NestedObjects +from django.forms.models import ModelForm, modelform_factory +from django.utils import simplejson as json from django.utils.encoding import smart_unicode -import staticmedia from .base import Plugin from ..extdirect import ext_action, ext_method -from django.core.exceptions import PermissionDenied -from django.utils import simplejson as json +import operator, staticmedia @ext_action(name='models') diff --git a/contrib/gilbert/sites.py b/contrib/gilbert/sites.py index e181fdf..3b4124d 100644 --- a/contrib/gilbert/sites.py +++ b/contrib/gilbert/sites.py @@ -1,31 +1,26 @@ +from django.conf import settings +from django.contrib.auth import authenticate, login +from django.core.context_processors import csrf from django.conf.urls.defaults import url, patterns, include from django.core.urlresolvers import reverse +from django.db.models.base import ModelBase +from django.forms.models import model_to_dict +from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response -from django.conf import settings +from django.template import RequestContext from django.utils import simplejson as json from django.utils.datastructures import SortedDict - -from django.db.models.base import ModelBase -from philo.utils import fattr -from .exceptions import AlreadyRegistered, NotRegistered -from django.forms.models import model_to_dict -import sys -from inspect import getargspec from django.views.decorators.cache import never_cache +from philo.utils import fattr from . import __version__ as gilbert_version -import staticmedia -import os -import datetime +from .exceptions import AlreadyRegistered, NotRegistered from .extdirect import ExtAction, ExtRouter - -from functools import partial -from django.http import HttpResponse, HttpResponseRedirect -from django.template import RequestContext -from django.core.context_processors import csrf -from django.utils.functional import update_wrapper -from django.contrib.auth import authenticate, login -from .plugins.models import Models, ModelAdmin from .plugins.auth import Auth +from .plugins.models import Models, ModelAdmin +from inspect import getargspec +from functools import partial, update_wrapper +import sys, os, datetime + __all__ = ('GilbertSite', 'site')