Ticket #4607: fallback_plus_new.patch
File fallback_plus_new.patch, 6.6 KB (added by , 17 years ago) |
---|
-
django/contrib/admin/views/main.py
14 14 from django.utils.text import capfirst, get_text_list 15 15 import operator 16 16 17 import __builtin__ 18 if not hasattr(__builtin__, 'set'): 19 from sets import Set as set # Python 2.3 fallback 20 17 21 from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION 18 22 if not LogEntry._meta.installed: 19 23 raise ImproperlyConfigured, "You'll need to put 'django.contrib.admin' in your INSTALLED_APPS setting before you can use the admin application." … … 489 493 perms_needed.add(related.opts.verbose_name) 490 494 491 495 def delete_stage(request, app_label, model_name, object_id): 492 import sets493 496 model = models.get_model(app_label, model_name) 494 497 object_id = unquote(object_id) 495 498 if model is None: … … 502 505 # Populate deleted_objects, a data structure of all related objects that 503 506 # will also be deleted. 504 507 deleted_objects = ['%s: <a href="../../%s/">%s</a>' % (capfirst(opts.verbose_name), object_id, escape(str(obj))), []] 505 perms_needed = set s.Set()508 perms_needed = set() 506 509 _get_deleted_objects(deleted_objects, perms_needed, request.user, obj, opts, 1) 507 510 508 511 if request.POST: # The user has already confirmed the deletion. -
django/contrib/auth/models.py
5 5 from django.utils.translation import gettext_lazy as _ 6 6 import datetime 7 7 8 import __builtin__ 9 if not hasattr(__builtin__, 'set'): 10 from sets import Set as set # Python 2.3 fallback 11 8 12 def check_password(raw_password, enc_password): 9 13 """ 10 14 Returns a boolean of whether the raw_password was correct. Handles … … 175 179 def get_group_permissions(self): 176 180 "Returns a list of permission strings that this user has through his/her groups." 177 181 if not hasattr(self, '_group_perm_cache'): 178 import sets179 182 cursor = connection.cursor() 180 183 # The SQL below works out to the following, after DB quoting: 181 184 # cursor.execute(""" … … 200 203 backend.quote_name('id'), backend.quote_name('content_type_id'), 201 204 backend.quote_name('user_id'),) 202 205 cursor.execute(sql, [self.id]) 203 self._group_perm_cache = set s.Set(["%s.%s" % (row[0], row[1]) for row in cursor.fetchall()])206 self._group_perm_cache = set(["%s.%s" % (row[0], row[1]) for row in cursor.fetchall()]) 204 207 return self._group_perm_cache 205 208 206 209 def get_all_permissions(self): 207 210 if not hasattr(self, '_perm_cache'): 208 211 import sets 209 self._perm_cache = set s.Set(["%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions.select_related()])212 self._perm_cache = set(["%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions.select_related()]) 210 213 self._perm_cache.update(self.get_group_permissions()) 211 214 return self._perm_cache 212 215 -
django/core/management.py
7 7 from django.utils import termcolors 8 8 import os, re, shutil, sys, textwrap 9 9 10 # For Python 2.3 11 if not hasattr(__builtin s__, 'set'):12 from sets import Set as set 10 import __builtin__ 11 if not hasattr(__builtin__, 'set'): 12 from sets import Set as set # Python 2.3 fallback 13 13 14 14 # For backwards compatibility: get_version() used to be in this module. 15 15 get_version = django.get_version -
django/db/models/fields/related.py
10 10 from django import newforms as forms 11 11 from django.dispatch import dispatcher 12 12 13 # For Python 2.3 14 if not hasattr(__builtin s__, 'set'):15 from sets import Set as set 13 import __builtin__ 14 if not hasattr(__builtin__, 'set'): 15 from sets import Set as set # Python 2.3 fallback 16 16 17 17 # Values for Relation.edit_inline. 18 18 TABULAR, STACKED = 1, 2 -
django/db/models/query.py
7 7 import operator 8 8 import re 9 9 10 # For Python 2.3 11 if not hasattr(__builtin s__, 'set'):12 from sets import Set as set 10 import __builtin__ 11 if not hasattr(__builtin__, 'set'): 12 from sets import Set as set # Python 2.3 fallback 13 13 14 14 # The string constant used to separate query parts 15 15 LOOKUP_SEPARATOR = '__' -
django/newforms/fields.py
26 26 # These values, if given to to_python(), will trigger the self.required check. 27 27 EMPTY_VALUES = (None, '') 28 28 29 try: 30 set # Only available in Python 2.4+ 31 except NameError: 32 from sets import Set as set # Python 2.3 fallback 29 import __builtin__ 30 if not hasattr(__builtin__, 'set'): 31 from sets import Set as set # Python 2.3 fallback 33 32 34 33 try: 35 34 from decimal import Decimal -
django/newforms/widgets.py
2 2 HTML Widget classes 3 3 """ 4 4 5 try: 6 set # Only available in Python 2.4+ 7 except NameError: 8 from sets import Set as set # Python 2.3 fallback 5 import __builtin__ 6 if not hasattr(__builtin__, 'set'): 7 from sets import Set as set # Python 2.3 fallback 8 9 9 from itertools import chain 10 10 11 11 from django.utils.datastructures import MultiValueDict -
django/template/defaulttags.py
8 8 import sys 9 9 import re 10 10 11 if not hasattr(__builtins__, 'reversed'): 12 # For Python 2.3. 11 import __builtin__ 12 if not hasattr(__builtin__, 'reversed'): 13 # Python 2.3 fallback. 13 14 # From http://www.python.org/doc/current/tut/node11.html 14 15 def reversed(data): 15 16 for index in xrange(len(data)-1, -1, -1):