1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed a bunch of imports of the email stdlib module now that we are on Python 2.5 to ease the Python 3 port. Thanks, Martin von Löwis.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16731 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-09-09 16:18:38 +00:00
parent 387e192f25
commit ddaca29d3d
6 changed files with 13 additions and 12 deletions

View File

@@ -139,7 +139,7 @@ class DatabaseCache(BaseDatabaseCache):
if connections[db].vendor == 'oracle':
# Special case for Oracle because it doesn't support LIMIT + OFFSET
cursor.execute("SELECT cache_key FROM (SELECT ROW_NUMBER() OVER (ORDER BY cache_key) AS counter, cache_key FROM %s) WHERE counter > %%s AND COUNTER <= %%s" % table, [cull_num, cull_num + 1])
else:
else:
# This isn't standard SQL, it's likely to break with some non officially supported databases
cursor.execute("SELECT cache_key FROM %s ORDER BY cache_key LIMIT 1 OFFSET %%s" % table, [cull_num])
cursor.execute("DELETE FROM %s WHERE cache_key < %%s" % table, [cursor.fetchone()[0]])

View File

@@ -2,13 +2,13 @@ import mimetypes
import os
import random
import time
from email import Charset, Encoders
from email import charset as Charset, encoders as Encoders
from email.generator import Generator
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils import formatdate, getaddresses, formataddr, parseaddr
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.header import Header
from email.utils import formatdate, getaddresses, formataddr, parseaddr
from django.conf import settings
from django.core.mail.utils import DNS_NAME

View File

@@ -78,7 +78,7 @@ class Command(BaseCommand):
return zipfile.ZipFile.read(self, self.namelist()[0])
compression_types = {
None: file,
None: open,
'gz': gzip.GzipFile,
'zip': SingleZipReader
}