Ticket #6897: newstyle.diff
File newstyle.diff, 9.0 KB (added by , 17 years ago) |
---|
-
django/test/client.py
95 95 ]) 96 96 return '\r\n'.join(lines) 97 97 98 class Client :98 class Client(object): 99 99 """ 100 100 A class that can act as a client for testing purposes. 101 101 -
django/db/models/fields/__init__.py
21 21 from django.utils.encoding import smart_unicode, force_unicode, smart_str 22 22 from django.utils.maxlength import LegacyMaxlength 23 23 24 class NOT_PROVIDED :24 class NOT_PROVIDED(object): 25 25 pass 26 26 27 27 # Values for filter_interface. -
django/db/backends/mysql_old/base.py
39 39 40 40 # This is an extra debug layer over MySQL queries, to display warnings. 41 41 # It's only used when DEBUG=True. 42 class MysqlDebugWrapper :42 class MysqlDebugWrapper(object): 43 43 def __init__(self, cursor): 44 44 self.cursor = cursor 45 45 … … 58 58 raise Database.Warning("%s: %s" % (w, self.cursor.fetchall())) 59 59 60 60 def __getattr__(self, attr): 61 if attr in self.__dict__: 62 return self.__dict__[attr] 63 else: 64 return getattr(self.cursor, attr) 61 return getattr(self.cursor, attr) 65 62 66 63 class DatabaseFeatures(BaseDatabaseFeatures): 67 64 autoindexes_primary_keys = False -
django/db/backends/sqlite3/introspection.py
74 74 # This light wrapper "fakes" a dictionary interface, because some SQLite data 75 75 # types include variables in them -- e.g. "varchar(30)" -- and can't be matched 76 76 # as a simple dictionary lookup. 77 class FlexibleFieldLookupDict :77 class FlexibleFieldLookupDict(object): 78 78 def __getitem__(self, key): 79 79 key = key.lower() 80 80 try: -
django/oldforms/__init__.py
549 549 {{ option.field }} {{ option.label }}<br /> 550 550 {% endfor %} 551 551 """ 552 class RadioFieldRenderer :552 class RadioFieldRenderer(object): 553 553 def __init__(self, datalist, ul_class): 554 554 self.datalist, self.ul_class = datalist, ul_class 555 555 def __unicode__(self): -
django/core/management/validation.py
2 2 from django.core.management.color import color_style 3 3 from django.utils.itercompat import is_iterable 4 4 5 class ModelErrorCollection :5 class ModelErrorCollection(object): 6 6 def __init__(self, outfile=sys.stdout): 7 7 self.errors = [] 8 8 self.outfile = outfile -
django/core/management/color.py
23 23 """Returns a Style object with the Django color scheme.""" 24 24 if not supports_color(): 25 25 return no_style() 26 class dummy: pass 26 class dummy(object): 27 pass 27 28 style = dummy() 28 29 style.ERROR = termcolors.make_style(fg='red', opts=('bold',)) 29 30 style.ERROR_OUTPUT = termcolors.make_style(fg='red', opts=('bold',)) … … 36 37 37 38 def no_style(): 38 39 """Returns a Style object that has no colors.""" 39 class dummy :40 class dummy(object): 40 41 def __getattr__(self, attr): 41 42 return lambda x: x 42 43 return dummy() -
django/dispatch/saferef.py
174 174 is equally fast, but not 100% reliable because functions can be stored on an 175 175 attribute named differenty than the function's name such as in: 176 176 177 class A : pass177 class A(object): pass 178 178 def foo(self): return "foo" 179 179 A.bar = foo 180 180 -
django/dispatch/dispatcher.py
33 33 __version__ = "$Revision: 1.9 $"[11:-2] 34 34 35 35 36 class _Parameter :36 class _Parameter(object): 37 37 """Used to represent default parameter values.""" 38 38 def __repr__(self): 39 39 return self.__class__.__name__ -
django/utils/_decimal.py
392 392 except ImportError: 393 393 # Python was compiled without threads; create a mock object instead 394 394 import sys 395 class MockThreading :395 class MockThreading(object): 396 396 def local(self, sys=sys): 397 397 return sys.modules[__name__] 398 398 threading = MockThreading() -
django/utils/daemonize.py
51 51 else: 52 52 sys.stdout = NullDevice() 53 53 54 class NullDevice :54 class NullDevice(object): 55 55 "A writeable object that writes to nowhere -- like /dev/null." 56 56 def write(self, s): 57 57 pass -
django/utils/synch.py
11 11 except ImportError: 12 12 import dummy_threading as threading 13 13 14 class RWLock :14 class RWLock(object): 15 15 """ 16 16 Classic implementation of reader-writer lock with preference to writers. 17 17 -
django/contrib/comments/templatetags/comments.py
136 136 context[self.var_name] = comment_list 137 137 return '' 138 138 139 class DoCommentForm :139 class DoCommentForm(object): 140 140 """ 141 141 Displays a comment form for the given params. 142 142 … … 211 211 raise template.TemplateSyntaxError, "%r tag got invalid parameter '%s'" % (tokens[0], option) 212 212 return CommentFormNode(content_type, obj_id_lookup_var, obj_id, self.free, **kwargs) 213 213 214 class DoCommentCount :214 class DoCommentCount(object): 215 215 """ 216 216 Gets comment count for the given params and populates the template context 217 217 with a variable containing that value, whose name is defined by the 'as' … … 261 261 raise template.TemplateSyntaxError, "Fourth argument in %r must be 'as'" % tokens[0] 262 262 return CommentCountNode(package, module, var_name, obj_id, tokens[5], self.free) 263 263 264 class DoGetCommentList :264 class DoGetCommentList(object): 265 265 """ 266 266 Gets comments for the given params and populates the template context with a 267 267 special comment_package variable, whose name is defined by the ``as`` -
django/contrib/sitemaps/__init__.py
33 33 params = urllib.urlencode({'sitemap':url}) 34 34 urllib.urlopen("%s?%s" % (ping_url, params)) 35 35 36 class Sitemap :36 class Sitemap(object): 37 37 def __get(self, name, obj, default=None): 38 38 try: 39 39 attr = getattr(self, name) -
django/contrib/admin/templatetags/log.py
19 19 context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related()[:self.limit] 20 20 return '' 21 21 22 class DoGetAdminLog :22 class DoGetAdminLog(object): 23 23 """ 24 24 Populates a template variable with the admin log for the given criteria. 25 25 -
django/template/defaulttags.py
252 252 return self.nodelist_false.render(context) 253 253 return self.nodelist_true.render(context) 254 254 255 class LinkTypes :255 class LinkTypes(object): 256 256 and_ = 0, 257 257 or_ = 1 258 258