Changeset 3113
- Timestamp:
- 06/08/06 00:00:13 (2 years ago)
- Files:
-
- django/trunk/django/conf/__init__.py (modified) (3 diffs)
- django/trunk/django/contrib/auth/middleware.py (modified) (1 diff)
- django/trunk/django/contrib/flatpages/middleware.py (modified) (1 diff)
- django/trunk/django/contrib/redirects/middleware.py (modified) (1 diff)
- django/trunk/django/contrib/sessions/middleware.py (modified) (1 diff)
- django/trunk/django/contrib/syndication/feeds.py (modified) (1 diff)
- django/trunk/django/core/cache/backends/base.py (modified) (1 diff)
- django/trunk/django/core/context_processors.py (modified) (3 diffs)
- django/trunk/django/core/handlers/base.py (modified) (1 diff)
- django/trunk/django/core/paginator.py (modified) (1 diff)
- django/trunk/django/core/servers/basehttp.py (modified) (4 diffs)
- django/trunk/django/core/urlresolvers.py (modified) (1 diff)
- django/trunk/django/core/validators.py (modified) (15 diffs)
- django/trunk/django/db/backends/util.py (modified) (1 diff)
- django/trunk/django/db/models/fields/__init__.py (modified) (1 diff)
- django/trunk/django/db/models/fields/related.py (modified) (2 diffs)
- django/trunk/django/db/models/__init__.py (modified) (1 diff)
- django/trunk/django/db/models/options.py (modified) (2 diffs)
- django/trunk/django/db/models/query.py (modified) (1 diff)
- django/trunk/django/forms/__init__.py (modified) (4 diffs)
- django/trunk/django/middleware/cache.py (modified) (1 diff)
- django/trunk/django/middleware/common.py (modified) (1 diff)
- django/trunk/django/middleware/doc.py (modified) (1 diff)
- django/trunk/django/middleware/gzip.py (modified) (1 diff)
- django/trunk/django/middleware/http.py (modified) (1 diff)
- django/trunk/django/middleware/locale.py (modified) (1 diff)
- django/trunk/django/middleware/transaction.py (modified) (1 diff)
- django/trunk/django/template/context.py (modified) (1 diff)
- django/trunk/django/template/__init__.py (modified) (4 diffs)
- django/trunk/django/utils/datastructures.py (modified) (1 diff)
- django/trunk/django/utils/dateformat.py (modified) (1 diff)
- django/trunk/django/utils/feedgenerator.py (modified) (2 diffs)
- django/trunk/tests/othertests/templates.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/conf/__init__.py
r2929 r3113 13 13 ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE" 14 14 15 class LazySettings :15 class LazySettings(object): 16 16 """ 17 17 A lazy proxy for either global Django settings or a custom settings object. … … 68 68 self._target = holder 69 69 70 class Settings :70 class Settings(object): 71 71 def __init__(self, settings_module): 72 72 # update this dict from global settings (but only for ALL_CAPS settings) … … 113 113 return dir(self) 114 114 115 class UserSettingsHolder :115 class UserSettingsHolder(object): 116 116 """ 117 117 Holder for user configured settings. django/trunk/django/contrib/auth/middleware.py
r2809 r3113 13 13 return self._user 14 14 15 class AuthenticationMiddleware :15 class AuthenticationMiddleware(object): 16 16 def process_request(self, request): 17 17 assert hasattr(request, 'session'), "The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." django/trunk/django/contrib/flatpages/middleware.py
r2809 r3113 3 3 from django.conf import settings 4 4 5 class FlatpageFallbackMiddleware :5 class FlatpageFallbackMiddleware(object): 6 6 def process_response(self, request, response): 7 7 if response.status_code != 404: django/trunk/django/contrib/redirects/middleware.py
r2809 r3113 3 3 from django.conf import settings 4 4 5 class RedirectFallbackMiddleware :5 class RedirectFallbackMiddleware(object): 6 6 def process_response(self, request, response): 7 7 if response.status_code != 404: django/trunk/django/contrib/sessions/middleware.py
r3049 r3113 65 65 _session = property(_get_session) 66 66 67 class SessionMiddleware :67 class SessionMiddleware(object): 68 68 def process_request(self, request): 69 69 request.session = SessionWrapper(request.COOKIES.get(settings.SESSION_COOKIE_NAME, None)) django/trunk/django/contrib/syndication/feeds.py
r2809 r3113 13 13 pass 14 14 15 class Feed :15 class Feed(object): 16 16 item_pubdate = None 17 17 item_enclosure_url = None django/trunk/django/core/cache/backends/base.py
r2378 r3113 6 6 pass 7 7 8 class BaseCache :8 class BaseCache(object): 9 9 def __init__(self, params): 10 10 timeout = params.get('timeout', 300) django/trunk/django/core/context_processors.py
r3091 r3113 37 37 else: 38 38 context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE 39 39 40 40 from django.utils import translation 41 41 context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi() … … 49 49 # the template system can understand. 50 50 51 class PermLookupDict :51 class PermLookupDict(object): 52 52 def __init__(self, user, module_name): 53 53 self.user, self.module_name = user, module_name … … 59 59 return self.user.has_module_perms(self.module_name) 60 60 61 class PermWrapper :61 class PermWrapper(object): 62 62 def __init__(self, user): 63 63 self.user = user django/trunk/django/core/handlers/base.py
r2990 r3113 4 4 import sys 5 5 6 class BaseHandler :6 class BaseHandler(object): 7 7 def __init__(self): 8 8 self._request_middleware = self._view_middleware = self._response_middleware = self._exception_middleware = None django/trunk/django/core/paginator.py
r3040 r3113 5 5 pass 6 6 7 class ObjectPaginator :7 class ObjectPaginator(object): 8 8 """ 9 9 This class makes pagination easy. Feed it a QuerySet, plus the number of django/trunk/django/core/servers/basehttp.py
r2809 r3113 22 22 pass 23 23 24 class FileWrapper :24 class FileWrapper(object): 25 25 """Wrapper to convert file-like objects to iterables""" 26 26 … … 64 64 return param 65 65 66 class Headers :66 class Headers(object): 67 67 """Manage a collection of HTTP response headers""" 68 68 def __init__(self,headers): … … 219 219 return _hoppish(header_name.lower()) 220 220 221 class ServerHandler :221 class ServerHandler(object): 222 222 """Manage the invocation of a WSGI application""" 223 223 … … 592 592 sys.stderr.write("[%s] %s\n" % (self.log_date_time_string(), format % args)) 593 593 594 class AdminMediaHandler :594 class AdminMediaHandler(object): 595 595 """ 596 596 WSGI middleware that intercepts calls to the admin media directory, as django/trunk/django/core/urlresolvers.py
r3057 r3113 84 84 return str(value) # TODO: Unicode? 85 85 86 class RegexURLPattern :86 class RegexURLPattern(object): 87 87 def __init__(self, regex, callback, default_args=None): 88 88 # regex is a string representing a regular expression. django/trunk/django/core/validators.py
r3070 r3113 238 238 get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in words_seen], 'and') 239 239 240 class AlwaysMatchesOtherField :240 class AlwaysMatchesOtherField(object): 241 241 def __init__(self, other_field_name, error_message=None): 242 242 self.other = other_field_name … … 248 248 raise ValidationError, self.error_message 249 249 250 class ValidateIfOtherFieldEquals :250 class ValidateIfOtherFieldEquals(object): 251 251 def __init__(self, other_field, other_value, validator_list): 252 252 self.other_field, self.other_value = other_field, other_value … … 259 259 v(field_data, all_data) 260 260 261 class RequiredIfOtherFieldNotGiven :261 class RequiredIfOtherFieldNotGiven(object): 262 262 def __init__(self, other_field_name, error_message=gettext_lazy("Please enter something for at least one field.")): 263 263 self.other, self.error_message = other_field_name, error_message … … 268 268 raise ValidationError, self.error_message 269 269 270 class RequiredIfOtherFieldsGiven :270 class RequiredIfOtherFieldsGiven(object): 271 271 def __init__(self, other_field_names, error_message=gettext_lazy("Please enter both fields or leave them both empty.")): 272 272 self.other, self.error_message = other_field_names, error_message … … 283 283 RequiredIfOtherFieldsGiven.__init__(self, [other_field_name], error_message) 284 284 285 class RequiredIfOtherFieldEquals :285 class RequiredIfOtherFieldEquals(object): 286 286 def __init__(self, other_field, other_value, error_message=None): 287 287 self.other_field = other_field … … 295 295 raise ValidationError(self.error_message) 296 296 297 class RequiredIfOtherFieldDoesNotEqual :297 class RequiredIfOtherFieldDoesNotEqual(object): 298 298 def __init__(self, other_field, other_value, error_message=None): 299 299 self.other_field = other_field … … 307 307 raise ValidationError(self.error_message) 308 308 309 class IsLessThanOtherField :309 class IsLessThanOtherField(object): 310 310 def __init__(self, other_field_name, error_message): 311 311 self.other, self.error_message = other_field_name, error_message … … 315 315 raise ValidationError, self.error_message 316 316 317 class UniqueAmongstFieldsWithPrefix :317 class UniqueAmongstFieldsWithPrefix(object): 318 318 def __init__(self, field_name, prefix, error_message): 319 319 self.field_name, self.prefix = field_name, prefix … … 325 325 raise ValidationError, self.error_message 326 326 327 class IsAPowerOf :327 class IsAPowerOf(object): 328 328 """ 329 329 >>> v = IsAPowerOf(2) … … 343 343 raise ValidationError, gettext("This value must be a power of %s.") % self.power_of 344 344 345 class IsValidFloat :345 class IsValidFloat(object): 346 346 def __init__(self, max_digits, decimal_places): 347 347 self.max_digits, self.decimal_places = max_digits, decimal_places … … 360 360 "Please enter a valid decimal number with at most %s decimal places.", self.decimal_places) % self.decimal_places 361 361 362 class HasAllowableSize :362 class HasAllowableSize(object): 363 363 """ 364 364 Checks that the file-upload field data is a certain size. min_size and … … 380 380 raise ValidationError, self.max_error_message 381 381 382 class MatchesRegularExpression :382 class MatchesRegularExpression(object): 383 383 """ 384 384 Checks that the field matches the given regular-expression. The regex … … 393 393 raise ValidationError(self.error_message) 394 394 395 class AnyValidator :395 class AnyValidator(object): 396 396 """ 397 397 This validator tries all given validators. If any one of them succeeds, … … 417 417 raise ValidationError(self.error_message) 418 418 419 class URLMimeTypeCheck :419 class URLMimeTypeCheck(object): 420 420 "Checks that the provided URL points to a document with a listed mime type" 421 421 class CouldNotRetrieve(ValidationError): … … 442 442 'url': field_data, 'contenttype': content_type} 443 443 444 class RelaxNGCompact :444 class RelaxNGCompact(object): 445 445 "Validate against a Relax NG compact schema" 446 446 def __init__(self, schema_path, additional_root_element=None): django/trunk/django/db/backends/util.py
r3038 r3113 2 2 from time import time 3 3 4 class CursorDebugWrapper :4 class CursorDebugWrapper(object): 5 5 def __init__(self, cursor, db): 6 6 self.cursor = cursor django/trunk/django/db/models/fields/__init__.py
r3073 r3113 536 536 if rel: 537 537 # This validator makes sure FileFields work in a related context. 538 class RequiredFileField :538 class RequiredFileField(object): 539 539 def __init__(self, other_field_names, other_file_field_name): 540 540 self.other_field_names = other_field_names django/trunk/django/db/models/fields/related.py
r3075 r3113 668 668 pass 669 669 670 class ManyToOneRel :670 class ManyToOneRel(object): 671 671 def __init__(self, to, field_name, num_in_admin=3, min_num_in_admin=None, 672 672 max_num_in_admin=None, num_extra_on_change=1, edit_inline=False, … … 705 705 self.multiple = False 706 706 707 class ManyToManyRel :707 class ManyToManyRel(object): 708 708 def __init__(self, to, num_in_admin=0, related_name=None, 709 709 filter_interface=None, limit_choices_to=None, raw_id_admin=False, symmetrical=True): django/trunk/django/db/models/__init__.py
r3089 r3113 16 16 ADD, CHANGE, BOTH = 1, 2, 3 17 17 18 class LazyDate :18 class LazyDate(object): 19 19 """ 20 20 Use in limit_choices_to to compare the field to dates calculated at run time django/trunk/django/db/models/options.py
r2909 r3113 16 16 'order_with_respect_to', 'app_label') 17 17 18 class Options :18 class Options(object): 19 19 def __init__(self, meta): 20 20 self.fields, self.many_to_many = [], [] … … 196 196 return self._field_types[field_type] 197 197 198 class AdminOptions :198 class AdminOptions(object): 199 199 def __init__(self, fields=None, js=None, list_display=None, list_filter=None, 200 200 date_hierarchy=None, save_as=False, ordering=None, search_fields=None, django/trunk/django/db/models/query.py
r3092 r3113 547 547 return c 548 548 549 class QOperator :549 class QOperator(object): 550 550 "Base class for QAnd and QOr" 551 551 def __init__(self, *args): django/trunk/django/forms/__init__.py
r3110 r3113 102 102 field.convert_post_data(new_data) 103 103 104 class FormWrapper :104 class FormWrapper(object): 105 105 """ 106 106 A wrapper linking a Manipulator to the template system. … … 151 151 fields = property(_get_fields) 152 152 153 class FormFieldWrapper :153 class FormFieldWrapper(object): 154 154 "A bridge between the template system and an individual form field. Used by FormWrapper." 155 155 def __init__(self, formfield, data, error_list): … … 212 212 return ''.join([field.html_error_list() for field in self.formfield_dict.values() if hasattr(field, 'errors')]) 213 213 214 class InlineObjectCollection :214 class InlineObjectCollection(object): 215 215 "An object that acts like a sparse list of form field collections." 216 216 def __init__(self, parent_manipulator, rel_obj, data, errors): … … 270 270 271 271 272 class FormField :272 class FormField(object): 273 273 """Abstract class representing a form field. 274 274 django/trunk/django/middleware/cache.py
r2809 r3113 4 4 from django.http import HttpResponseNotModified 5 5 6 class CacheMiddleware :6 class CacheMiddleware(object): 7 7 """ 8 8 Cache middleware. If this is enabled, each Django-powered page will be django/trunk/django/middleware/common.py
r3109 r3113 4 4 import md5, os 5 5 6 class CommonMiddleware :6 class CommonMiddleware(object): 7 7 """ 8 8 "Common" middleware for taking care of some basic operations: django/trunk/django/middleware/doc.py
r2809 r3113 2 2 from django import http 3 3 4 class XViewMiddleware :4 class XViewMiddleware(object): 5 5 """ 6 6 Adds an X-View header to internal HEAD requests -- used by the documentation system. django/trunk/django/middleware/gzip.py
r810 r3113 5 5 re_accepts_gzip = re.compile(r'\bgzip\b') 6 6 7 class GZipMiddleware :7 class GZipMiddleware(object): 8 8 """ 9 9 This middleware compresses content if the browser allows gzip compression. django/trunk/django/middleware/http.py
r810 r3113 1 1 import datetime 2 2 3 class ConditionalGetMiddleware :3 class ConditionalGetMiddleware(object): 4 4 """ 5 5 Handles conditional GET operations. If the response has a ETag or django/trunk/django/middleware/locale.py
r2843 r3113 4 4 from django.utils import translation 5 5 6 class LocaleMiddleware :6 class LocaleMiddleware(object): 7 7 """ 8 8 This is a very simple middleware that parses a request django/trunk/django/middleware/transaction.py
r2809 r3113 2 2 from django.db import transaction 3 3 4 class TransactionMiddleware :4 class TransactionMiddleware(object): 5 5 """ 6 6 Transaction middleware. If this is enabled, each view function will be run django/trunk/django/template/context.py
r2809 r3113 8 8 pass 9 9 10 class Context :10 class Context(object): 11 11 "A stack container for variable context" 12 12 def __init__(self, dict_=None): django/trunk/django/template/__init__.py
r3112 r3113 135 135 return self.source 136 136 137 class Template :137 class Template(object): 138 138 def __init__(self, template_string, origin=None): 139 139 "Compilation stage" … … 159 159 return parser.parse() 160 160 161 class Token :161 class Token(object): 162 162 def __init__(self, token_type, contents): 163 163 "The token_type must be TOKEN_TEXT, TOKEN_VAR or TOKEN_BLOCK" … … 377 377 return Parser(*args, **kwargs) 378 378 379 class TokenParser :379 class TokenParser(object): 380 380 """ 381 381 Subclass this and implement the top() method to parse a template line. When … … 655 655 return current 656 656 657 class Node :657 class Node(object): 658 658 def render(self, context): 659 659 "Return the node rendered as a string" django/trunk/django/utils/datastructures.py
r3081 r3113 1 class MergeDict :1 class MergeDict(object): 2 2 """ 3 3 A simple class for creating new "virtual" dictionaries that actualy look django/trunk/django/utils/dateformat.py
r1116 r3113 20 20 re_escaped = re.compile(r'\\(.)') 21 21 22 class Formatter :22 class Formatter(object): 23 23 def format(self, formatstr): 24 24 pieces = [] django/trunk/django/utils/feedgenerator.py
r3004 r3113 37 37 return 'tag:' + tag 38 38 39 class SyndicationFeed :39 class SyndicationFeed(object): 40 40 "Base class for all syndication feeds. Subclasses should provide write()" 41 41 def __init__(self, title, link, description, language=None, author_email=None, … … 109 109 return datetime.datetime.now() 110 110 111 class Enclosure :111 class Enclosure(object): 112 112 "Represents an RSS enclosure" 113 113 def __init__(self, url, length, mime_type): django/trunk/tests/othertests/templates.py
r3112 r3113 170 170 171 171 ### CYCLE TAG ############################################################# 172 #'cycleXX': ('', {}, ''), 173 'cycle01': ('{% cycle a, %}', {}, 'a'), 172 'cycle01': ('{% cycle a %}', {}, template.TemplateSyntaxError), 174 173 'cycle02': ('{% cycle a,b,c as abc %}{% cycle abc %}', {}, 'ab'), 175 174 'cycle03': ('{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}', {}, 'abc'),
