From 54d1617957cfa3a8c9ffd714ad6c4bef09e727de Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Mon, 9 May 2011 10:26:26 -0400 Subject: [PATCH] Removed Sobol's automatic use of eventlet. Adjusted imports project-wide to conform to PEP8. --- philo/admin/base.py | 3 ++- philo/admin/collections.py | 1 + philo/admin/forms/attributes.py | 1 + philo/admin/forms/containers.py | 1 + philo/admin/nodes.py | 3 ++- philo/admin/pages.py | 5 +++-- philo/admin/widgets.py | 4 ++-- philo/contrib/julian/admin.py | 1 + philo/contrib/julian/models.py | 5 ++++- philo/contrib/penfield/admin.py | 1 + philo/contrib/penfield/middleware.py | 1 + philo/contrib/penfield/models.py | 5 ++++- philo/contrib/shipherd/admin.py | 1 + philo/contrib/shipherd/models.py | 4 +++- philo/contrib/sobol/admin.py | 4 +++- philo/contrib/sobol/forms.py | 1 + philo/contrib/sobol/models.py | 16 +++++++++++----- philo/contrib/sobol/search.py | 13 +++++++++---- philo/contrib/sobol/utils.py | 3 ++- philo/contrib/waldo/forms.py | 2 ++ philo/contrib/waldo/models.py | 4 +++- philo/contrib/waldo/tokens.py | 4 ++-- philo/forms/entities.py | 1 + philo/forms/fields.py | 1 + philo/loaders/database.py | 1 + philo/middleware.py | 1 + philo/models/base.py | 10 ++++++---- philo/models/collections.py | 7 ++++--- philo/models/fields/__init__.py | 1 + philo/models/fields/entities.py | 6 ++++-- philo/models/nodes.py | 13 +++++++------ philo/models/pages.py | 3 ++- philo/templatetags/containers.py | 4 ++-- philo/templatetags/embed.py | 3 ++- philo/templatetags/nodes.py | 1 + philo/urls.py | 1 + philo/validators.py | 8 +++++--- philo/views.py | 1 + 38 files changed, 100 insertions(+), 45 deletions(-) diff --git a/philo/admin/base.py b/philo/admin/base.py index 75fa336..3a9458e 100644 --- a/philo/admin/base.py +++ b/philo/admin/base.py @@ -4,12 +4,13 @@ from django.contrib.contenttypes import generic from django.http import HttpResponse from django.utils import simplejson as json from django.utils.html import escape +from mptt.admin import MPTTModelAdmin + from philo.models import Tag, Attribute from philo.models.fields.entities import ForeignKeyAttribute, ManyToManyAttribute from philo.admin.forms.attributes import AttributeForm, AttributeInlineFormSet from philo.admin.widgets import TagFilteredSelectMultiple from philo.forms.entities import EntityForm, proxy_fields_for_entity_model -from mptt.admin import MPTTModelAdmin COLLAPSE_CLASSES = ('collapse', 'collapse-closed', 'closed',) diff --git a/philo/admin/collections.py b/philo/admin/collections.py index d422b74..c2a9034 100644 --- a/philo/admin/collections.py +++ b/philo/admin/collections.py @@ -1,4 +1,5 @@ from django.contrib import admin + from philo.admin.base import COLLAPSE_CLASSES from philo.models import CollectionMember, Collection diff --git a/philo/admin/forms/attributes.py b/philo/admin/forms/attributes.py index fc77d0f..5372ab3 100644 --- a/philo/admin/forms/attributes.py +++ b/philo/admin/forms/attributes.py @@ -1,6 +1,7 @@ from django.contrib.contenttypes.generic import BaseGenericInlineFormSet from django.contrib.contenttypes.models import ContentType from django.forms.models import ModelForm + from philo.models import Attribute diff --git a/philo/admin/forms/containers.py b/philo/admin/forms/containers.py index 420ba17..246a954 100644 --- a/philo/admin/forms/containers.py +++ b/philo/admin/forms/containers.py @@ -5,6 +5,7 @@ from django.db.models import Q from django.forms.models import ModelForm, BaseInlineFormSet, BaseModelFormSet from django.forms.formsets import TOTAL_FORM_COUNT from django.utils.datastructures import SortedDict + from philo.admin.widgets import ModelLookupWidget from philo.models import Contentlet, ContentReference diff --git a/philo/admin/nodes.py b/philo/admin/nodes.py index e2a9c9d..853ba25 100644 --- a/philo/admin/nodes.py +++ b/philo/admin/nodes.py @@ -1,7 +1,8 @@ from django.contrib import admin +from mptt.admin import MPTTModelAdmin + from philo.admin.base import EntityAdmin, TreeEntityAdmin, COLLAPSE_CLASSES from philo.models import Node, Redirect, File -from mptt.admin import MPTTModelAdmin class NodeAdmin(TreeEntityAdmin): diff --git a/philo/admin/pages.py b/philo/admin/pages.py index f9e96c0..fd8665b 100644 --- a/philo/admin/pages.py +++ b/philo/admin/pages.py @@ -1,10 +1,11 @@ +from django import forms from django.conf import settings from django.contrib import admin -from django import forms + from philo.admin.base import COLLAPSE_CLASSES, TreeAdmin +from philo.admin.forms.containers import * from philo.admin.nodes import ViewAdmin from philo.models.pages import Page, Template, Contentlet, ContentReference -from philo.admin.forms.containers import * class ContentletInline(admin.StackedInline): diff --git a/philo/admin/widgets.py b/philo/admin/widgets.py index fb13ac7..62a492b 100644 --- a/philo/admin/widgets.py +++ b/philo/admin/widgets.py @@ -1,10 +1,10 @@ from django import forms from django.conf import settings from django.contrib.admin.widgets import FilteredSelectMultiple, url_params_from_lookup_dict -from django.utils.translation import ugettext as _ +from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.text import truncate_words -from django.utils.html import escape +from django.utils.translation import ugettext as _ class ModelLookupWidget(forms.TextInput): diff --git a/philo/contrib/julian/admin.py b/philo/contrib/julian/admin.py index 8f104e2..cf72682 100644 --- a/philo/contrib/julian/admin.py +++ b/philo/contrib/julian/admin.py @@ -1,4 +1,5 @@ from django.contrib import admin + from philo.admin import EntityAdmin, COLLAPSE_CLASSES from philo.contrib.julian.models import Location, Event, Calendar, CalendarView diff --git a/philo/contrib/julian/models.py b/philo/contrib/julian/models.py index 5c49c7e..550513c 100644 --- a/philo/contrib/julian/models.py +++ b/philo/contrib/julian/models.py @@ -1,3 +1,6 @@ +import calendar +import datetime + from django.conf import settings from django.conf.urls.defaults import url, patterns, include from django.contrib.auth.models import User @@ -10,12 +13,12 @@ from django.db import models from django.db.models.query import QuerySet from django.http import HttpResponse, Http404 from django.utils.encoding import force_unicode + from philo.contrib.julian.feedgenerator import ICalendarFeed from philo.contrib.penfield.models import FeedView, FEEDS from philo.exceptions import ViewCanNotProvideSubpath from philo.models import Tag, Entity, Page, TemplateField from philo.utils import ContentTypeRegistryLimiter -import datetime, calendar __all__ = ('register_location_model', 'unregister_location_model', 'Location', 'TimedModel', 'Event', 'Calendar', 'CalendarView',) diff --git a/philo/contrib/penfield/admin.py b/philo/contrib/penfield/admin.py index c70cf46..a897b97 100644 --- a/philo/contrib/penfield/admin.py +++ b/philo/contrib/penfield/admin.py @@ -2,6 +2,7 @@ from django import forms from django.contrib import admin from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict + from philo.admin import EntityAdmin, AddTagAdmin, COLLAPSE_CLASSES from philo.contrib.penfield.models import BlogEntry, Blog, BlogView, Newsletter, NewsletterArticle, NewsletterIssue, NewsletterView diff --git a/philo/contrib/penfield/middleware.py b/philo/contrib/penfield/middleware.py index b25a28b..8bcff40 100644 --- a/philo/contrib/penfield/middleware.py +++ b/philo/contrib/penfield/middleware.py @@ -1,5 +1,6 @@ from django.http import HttpResponse from django.utils.decorators import decorator_from_middleware + from philo.contrib.penfield.exceptions import HttpNotAcceptable diff --git a/philo/contrib/penfield/models.py b/philo/contrib/penfield/models.py index a03bed8..6955069 100644 --- a/philo/contrib/penfield/models.py +++ b/philo/contrib/penfield/models.py @@ -1,3 +1,5 @@ +from datetime import date, datetime + from django.conf import settings from django.conf.urls.defaults import url, patterns, include from django.contrib.sites.models import Site, RequestSite @@ -9,13 +11,14 @@ from django.utils import feedgenerator, tzinfo from django.utils.datastructures import SortedDict from django.utils.encoding import smart_unicode, force_unicode from django.utils.html import escape -from datetime import date, datetime + from philo.contrib.penfield.exceptions import HttpNotAcceptable from philo.contrib.penfield.middleware import http_not_acceptable from philo.contrib.penfield.validators import validate_pagination_count from philo.exceptions import ViewCanNotProvideSubpath from philo.models import Tag, Titled, Entity, MultiView, Page, register_value_model, TemplateField, Template from philo.utils import paginate + try: import mimeparse except: diff --git a/philo/contrib/shipherd/admin.py b/philo/contrib/shipherd/admin.py index 93d21e5..be31a43 100644 --- a/philo/contrib/shipherd/admin.py +++ b/philo/contrib/shipherd/admin.py @@ -1,4 +1,5 @@ from django.contrib import admin + from philo.admin import TreeEntityAdmin, COLLAPSE_CLASSES, NodeAdmin, EntityAdmin from philo.models import Node from philo.contrib.shipherd.models import NavigationItem, Navigation diff --git a/philo/contrib/shipherd/models.py b/philo/contrib/shipherd/models.py index 654f5f8..3ff5c44 100644 --- a/philo/contrib/shipherd/models.py +++ b/philo/contrib/shipherd/models.py @@ -1,12 +1,14 @@ #encoding: utf-8 +from UserDict import DictMixin + from django.core.exceptions import ValidationError from django.core.urlresolvers import NoReverseMatch from django.core.validators import RegexValidator, MinValueValidator from django.db import models from django.forms.models import model_to_dict + from philo.models import TreeEntity, Node, TreeManager, Entity, TargetURLModel from philo.validators import RedirectValidator -from UserDict import DictMixin DEFAULT_NAVIGATION_DEPTH = 3 diff --git a/philo/contrib/sobol/admin.py b/philo/contrib/sobol/admin.py index 87dd39a..f4636e7 100644 --- a/philo/contrib/sobol/admin.py +++ b/philo/contrib/sobol/admin.py @@ -1,3 +1,5 @@ +from functools import update_wrapper + from django.conf import settings from django.conf.urls.defaults import patterns, url from django.contrib import admin @@ -7,9 +9,9 @@ from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ + from philo.admin import EntityAdmin from philo.contrib.sobol.models import Search, ResultURL, SearchView -from functools import update_wrapper class ResultURLInline(admin.TabularInline): diff --git a/philo/contrib/sobol/forms.py b/philo/contrib/sobol/forms.py index e79d9e7..f9994a1 100644 --- a/philo/contrib/sobol/forms.py +++ b/philo/contrib/sobol/forms.py @@ -1,4 +1,5 @@ from django import forms + from philo.contrib.sobol.utils import SEARCH_ARG_GET_KEY diff --git a/philo/contrib/sobol/models.py b/philo/contrib/sobol/models.py index ee8187d..2cb1651 100644 --- a/philo/contrib/sobol/models.py +++ b/philo/contrib/sobol/models.py @@ -1,3 +1,6 @@ +import datetime + +from django.conf import settings from django.conf.urls.defaults import patterns, url from django.contrib import messages from django.core.exceptions import ValidationError @@ -5,6 +8,7 @@ from django.db import models from django.http import HttpResponseRedirect, Http404, HttpResponse from django.utils import simplejson as json from django.utils.datastructures import SortedDict + from philo.contrib.sobol import registry from philo.contrib.sobol.forms import SearchForm from philo.contrib.sobol.utils import HASH_REDIRECT_GET_KEY, URL_REDIRECT_GET_KEY, SEARCH_ARG_GET_KEY, check_redirect_hash @@ -12,11 +16,13 @@ from philo.exceptions import ViewCanNotProvideSubpath from philo.models import MultiView, Page from philo.models.fields import SlugMultipleChoiceField from philo.validators import RedirectValidator -import datetime -try: - import eventlet -except: - eventlet = False + +eventlet = None +if getattr(settings, 'SOBOL_USE_EVENTLET', False): + try: + import eventlet + except: + pass class Search(models.Model): diff --git a/philo/contrib/sobol/search.py b/philo/contrib/sobol/search.py index 39b93c7..6cd577d 100644 --- a/philo/contrib/sobol/search.py +++ b/philo/contrib/sobol/search.py @@ -1,4 +1,5 @@ #encoding: utf-8 +import datetime from django.conf import settings from django.contrib.sites.models import Site @@ -9,12 +10,16 @@ from django.utils.http import urlquote_plus from django.utils.safestring import mark_safe from django.utils.text import capfirst from django.template import loader, Context, Template -import datetime + from philo.contrib.sobol.utils import make_tracking_querydict -try: - from eventlet.green import urllib2 -except: + +if getattr(settings, 'SOBOL_USE_EVENTLET', False): + try: + from eventlet.green import urllib2 + except: + import urllib2 +else: import urllib2 diff --git a/philo/contrib/sobol/utils.py b/philo/contrib/sobol/utils.py index 3c5e537..5c52c81 100644 --- a/philo/contrib/sobol/utils.py +++ b/philo/contrib/sobol/utils.py @@ -1,8 +1,9 @@ +from hashlib import sha1 + from django.conf import settings from django.http import QueryDict from django.utils.encoding import smart_str from django.utils.http import urlquote_plus, urlquote -from hashlib import sha1 SEARCH_ARG_GET_KEY = 'q' diff --git a/philo/contrib/waldo/forms.py b/philo/contrib/waldo/forms.py index 2ee64d0..4cc9874 100644 --- a/philo/contrib/waldo/forms.py +++ b/philo/contrib/waldo/forms.py @@ -1,4 +1,5 @@ from datetime import date + from django import forms from django.conf import settings from django.contrib.auth import authenticate @@ -6,6 +7,7 @@ from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ + from philo.contrib.waldo.tokens import REGISTRATION_TIMEOUT_DAYS diff --git a/philo/contrib/waldo/models.py b/philo/contrib/waldo/models.py index f63cdb1..87cfafe 100644 --- a/philo/contrib/waldo/models.py +++ b/philo/contrib/waldo/models.py @@ -1,3 +1,5 @@ +import urlparse + from django import forms from django.conf.urls.defaults import url, patterns, include from django.contrib import messages @@ -15,10 +17,10 @@ from django.utils.http import int_to_base36, base36_to_int from django.utils.translation import ugettext as _ from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_protect + from philo.models import MultiView, Page from philo.contrib.waldo.forms import WaldoAuthenticationForm, RegistrationForm, UserAccountForm from philo.contrib.waldo.tokens import registration_token_generator, email_token_generator -import urlparse class LoginMultiView(MultiView): diff --git a/philo/contrib/waldo/tokens.py b/philo/contrib/waldo/tokens.py index 80f0b11..858b073 100644 --- a/philo/contrib/waldo/tokens.py +++ b/philo/contrib/waldo/tokens.py @@ -2,12 +2,12 @@ Based on django.contrib.auth.tokens """ - +from hashlib import sha1 from datetime import date + from django.conf import settings from django.utils.http import int_to_base36, base36_to_int from django.contrib.auth.tokens import PasswordResetTokenGenerator -from hashlib import sha1 REGISTRATION_TIMEOUT_DAYS = getattr(settings, 'WALDO_REGISTRATION_TIMEOUT_DAYS', 1) diff --git a/philo/forms/entities.py b/philo/forms/entities.py index e781128..5d34cce 100644 --- a/philo/forms/entities.py +++ b/philo/forms/entities.py @@ -1,5 +1,6 @@ from django.forms.models import ModelFormMetaclass, ModelForm, ModelFormOptions from django.utils.datastructures import SortedDict + from philo.utils import fattr diff --git a/philo/forms/fields.py b/philo/forms/fields.py index b148947..8bb5ce3 100644 --- a/philo/forms/fields.py +++ b/philo/forms/fields.py @@ -1,6 +1,7 @@ from django import forms from django.core.exceptions import ValidationError from django.utils import simplejson as json + from philo.validators import json_validator diff --git a/philo/loaders/database.py b/philo/loaders/database.py index 141aedd..71b93a6 100644 --- a/philo/loaders/database.py +++ b/philo/loaders/database.py @@ -1,6 +1,7 @@ from django.template import TemplateDoesNotExist from django.template.loader import BaseLoader from django.utils.encoding import smart_unicode + from philo.models import Template diff --git a/philo/middleware.py b/philo/middleware.py index 5ec3e77..4082d4b 100644 --- a/philo/middleware.py +++ b/philo/middleware.py @@ -1,6 +1,7 @@ from django.conf import settings from django.contrib.sites.models import Site from django.http import Http404 + from philo.models import Node, View diff --git a/philo/models/base.py b/philo/models/base.py index cf420c7..466b60a 100644 --- a/philo/models/base.py +++ b/philo/models/base.py @@ -1,18 +1,20 @@ +from UserDict import DictMixin + from django import forms -from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.core.exceptions import ObjectDoesNotExist from django.core.validators import RegexValidator +from django.db import models from django.utils import simplejson as json from django.utils.encoding import force_unicode +from mptt.models import MPTTModel, MPTTModelBase, MPTTOptions + from philo.exceptions import AncestorDoesNotExist from philo.models.fields import JSONField -from philo.utils import ContentTypeRegistryLimiter, ContentTypeSubclassLimiter from philo.signals import entity_class_prepared +from philo.utils import ContentTypeRegistryLimiter, ContentTypeSubclassLimiter from philo.validators import json_validator -from UserDict import DictMixin -from mptt.models import MPTTModel, MPTTModelBase, MPTTOptions class Tag(models.Model): diff --git a/philo/models/collections.py b/philo/models/collections.py index 539ecdb..3513cb4 100644 --- a/philo/models/collections.py +++ b/philo/models/collections.py @@ -1,9 +1,10 @@ -from django.db import models -from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic +from django.contrib.contenttypes.models import ContentType +from django.db import models +from django.template import add_to_builtins as register_templatetags + from philo.models.base import value_content_type_limiter, register_value_model from philo.utils import fattr -from django.template import add_to_builtins as register_templatetags class Collection(models.Model): diff --git a/philo/models/fields/__init__.py b/philo/models/fields/__init__.py index 1f9603e..eca3a12 100644 --- a/philo/models/fields/__init__.py +++ b/philo/models/fields/__init__.py @@ -5,6 +5,7 @@ from django.db import models from django.utils import simplejson as json from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ + from philo.forms.fields import JSONFormField from philo.validators import TemplateValidator, json_validator #from philo.models.fields.entities import * diff --git a/philo/models/fields/entities.py b/philo/models/fields/entities.py index 6c407d0..68a4164 100644 --- a/philo/models/fields/entities.py +++ b/philo/models/fields/entities.py @@ -15,15 +15,17 @@ Example:: class ThingProxy(Thing): improvised = JSONAttribute(models.BooleanField) """ +import datetime from itertools import tee + from django import forms from django.core.exceptions import FieldError from django.db import models from django.db.models.fields import NOT_PROVIDED from django.utils.text import capfirst -from philo.signals import entity_class_prepared + from philo.models import ManyToManyValue, JSONValue, ForeignKeyValue, Attribute, Entity -import datetime +from philo.signals import entity_class_prepared __all__ = ('JSONAttribute', 'ForeignKeyAttribute', 'ManyToManyAttribute') diff --git a/philo/models/nodes.py b/philo/models/nodes.py index 99be196..b657795 100644 --- a/philo/models/nodes.py +++ b/philo/models/nodes.py @@ -1,20 +1,21 @@ -from django.db import models -from django.contrib.contenttypes.models import ContentType +from inspect import getargspec + from django.contrib.contenttypes import generic +from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site, RequestSite -from django.http import HttpResponse, HttpResponseServerError, HttpResponseRedirect, Http404 from django.core.exceptions import ValidationError from django.core.servers.basehttp import FileWrapper from django.core.urlresolvers import resolve, clear_url_caches, reverse, NoReverseMatch +from django.db import models +from django.http import HttpResponse, HttpResponseServerError, HttpResponseRedirect, Http404 from django.template import add_to_builtins as register_templatetags from django.utils.encoding import smart_str -from inspect import getargspec -from philo.exceptions import MIDDLEWARE_NOT_CONFIGURED + +from philo.exceptions import MIDDLEWARE_NOT_CONFIGURED, ViewCanNotProvideSubpath, ViewDoesNotProvideSubpaths from philo.models.base import TreeEntity, Entity, QuerySetMapper, register_value_model from philo.models.fields import JSONField from philo.utils import ContentTypeSubclassLimiter from philo.validators import RedirectValidator -from philo.exceptions import ViewCanNotProvideSubpath, ViewDoesNotProvideSubpaths, AncestorDoesNotExist from philo.signals import view_about_to_render, view_finished_rendering diff --git a/philo/models/pages.py b/philo/models/pages.py index 2221ee4..b69f3cf 100644 --- a/philo/models/pages.py +++ b/philo/models/pages.py @@ -8,13 +8,14 @@ from django.http import HttpResponse from django.template import TemplateDoesNotExist, Context, RequestContext, Template as DjangoTemplate, add_to_builtins as register_templatetags, TextNode, VariableNode from django.template.loader_tags import BlockNode, ExtendsNode, BlockContext from django.utils.datastructures import SortedDict + from philo.models.base import TreeModel, register_value_model from philo.models.fields import TemplateField from philo.models.nodes import View +from philo.signals import page_about_to_render_to_string, page_finished_rendering_to_string from philo.templatetags.containers import ContainerNode from philo.utils import fattr from philo.validators import LOADED_TEMPLATE_ATTR -from philo.signals import page_about_to_render_to_string, page_finished_rendering_to_string class LazyContainerFinder(object): diff --git a/philo/templatetags/containers.py b/philo/templatetags/containers.py index c5fd445..f6def0a 100644 --- a/philo/templatetags/containers.py +++ b/philo/templatetags/containers.py @@ -1,8 +1,8 @@ from django import template from django.conf import settings -from django.utils.safestring import SafeUnicode, mark_safe -from django.core.exceptions import ObjectDoesNotExist from django.contrib.contenttypes.models import ContentType +from django.core.exceptions import ObjectDoesNotExist +from django.utils.safestring import SafeUnicode, mark_safe register = template.Library() diff --git a/philo/templatetags/embed.py b/philo/templatetags/embed.py index eb4cd68..39b29e0 100644 --- a/philo/templatetags/embed.py +++ b/philo/templatetags/embed.py @@ -1,7 +1,8 @@ from django import template -from django.contrib.contenttypes.models import ContentType from django.conf import settings +from django.contrib.contenttypes.models import ContentType from django.template.loader_tags import ExtendsNode, BlockContext, BLOCK_CONTEXT_KEY, TextNode, BlockNode + from philo.utils import LOADED_TEMPLATE_ATTR diff --git a/philo/templatetags/nodes.py b/philo/templatetags/nodes.py index 5ae507d..00d9764 100644 --- a/philo/templatetags/nodes.py +++ b/philo/templatetags/nodes.py @@ -4,6 +4,7 @@ from django.contrib.sites.models import Site from django.core.urlresolvers import reverse, NoReverseMatch from django.template.defaulttags import kwarg_re from django.utils.encoding import smart_str + from philo.exceptions import ViewCanNotProvideSubpath diff --git a/philo/urls.py b/philo/urls.py index 0363224..d4dfc7b 100644 --- a/philo/urls.py +++ b/philo/urls.py @@ -1,4 +1,5 @@ from django.conf.urls.defaults import patterns, url + from philo.views import node_view diff --git a/philo/validators.py b/philo/validators.py index c8e5dc9..144699e 100644 --- a/philo/validators.py +++ b/philo/validators.py @@ -1,10 +1,12 @@ -from django.utils.translation import ugettext_lazy as _ -from django.core.validators import RegexValidator +import re + from django.core.exceptions import ValidationError +from django.core.validators import RegexValidator from django.template import Template, Parser, Lexer, TOKEN_BLOCK, TOKEN_VAR, TemplateSyntaxError from django.utils import simplejson as json from django.utils.html import escape, mark_safe -import re +from django.utils.translation import ugettext_lazy as _ + from philo.utils import LOADED_TEMPLATE_ATTR diff --git a/philo/views.py b/philo/views.py index 598be36..28740fd 100644 --- a/philo/views.py +++ b/philo/views.py @@ -2,6 +2,7 @@ from django.conf import settings from django.core.urlresolvers import resolve from django.http import Http404, HttpResponseRedirect from django.views.decorators.vary import vary_on_headers + from philo.exceptions import MIDDLEWARE_NOT_CONFIGURED -- 2.20.1