1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed a bunch of spurious imports, typos, and other small errors turned up by a pass through PyFlakes. This covers about the first third of the errors.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2006-07-21 17:11:13 +00:00
parent e9a236d86c
commit 17d0bd1512
25 changed files with 9 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
"Database cache backend."
from django.core.cache.backends.base import BaseCache
from django.db import connection, transaction
from django.db import connection, transaction, DatabaseError
import base64, time
from datetime import datetime
try:

View File

@@ -3,10 +3,6 @@
from django.core.cache.backends.simple import CacheClass as SimpleCacheClass
from django.utils.synch import RWLock
import copy, time
try:
import cPickle as pickle
except ImportError:
import pickle
class CacheClass(SimpleCacheClass):
def __init__(self, host, params):

View File

@@ -119,7 +119,6 @@ class BaseHandler(object):
Returns an HttpResponse that displays a PUBLIC error message for a
fundamental error.
"""
from django.core import urlresolvers
callback, param_dict = resolver.resolve500()
return callback(request, **param_dict)

View File

@@ -58,7 +58,6 @@ class WSGIRequest(http.HttpRequest):
self.method = environ['REQUEST_METHOD'].upper()
def __repr__(self):
from pprint import pformat
return '<WSGIRequest\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s>' % \
(pformat(self.GET), pformat(self.POST), pformat(self.COOKIES),
pformat(self.META))

View File

@@ -593,7 +593,6 @@ install.args = APP_ARGS
def reset(app):
"Executes the equivalent of 'get_sql_reset' in the current database."
from django.db import connection, transaction
from cStringIO import StringIO
app_name = app.__name__.split('.')[-2]
disable_termcolors()

View File

@@ -1,4 +1,3 @@
from copy import copy
from math import ceil
class InvalidPage(Exception):

View File

@@ -79,7 +79,7 @@ def Deserializer(object_list, **options):
elif field.rel and isinstance(field.rel, models.ManyToOneRel):
try:
data[field.name] = field.rel.to._default_manager.get(pk=field_value)
except RelatedModel.DoesNotExist:
except field.rel.to.DoesNotExist:
data[field.name] = None
# Handle all other fields

View File

@@ -8,7 +8,7 @@ been reviewed for security issues. Don't use it for production use.
"""
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from types import ListType, StringType, TupleType
from types import ListType, StringType
import os, re, sys, time, urllib
__version__ = "0.1"