Django

Code

Changeset 5451

Show
Ignore:
Timestamp:
06/09/07 21:00:46 (2 years ago)
Author:
mtredinnick
Message:

Fixed #4517 -- Made sure that URL_VALIDATOR_USER_AGENT includes the up-to-date
Django version number. Thanks, James Wheare.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r5403 r5451  
    235235    Dan Watson <http://theidioteque.net/> 
    236236    Chris Wesseling <Chris.Wesseling@cwi.nl> 
     237    James Wheare <django@sparemint.com> 
    237238    charly.wilhelm@gmail.com 
    238239    Rachel Willmer <http://www.willmer.com/kb/> 
  • django/trunk/django/conf/global_settings.py

    r5380 r5451  
    242242# The User-Agent string to use when checking for URL validity through the 
    243243# isExistingURL validator. 
    244 URL_VALIDATOR_USER_AGENT = "Django/0.96pre (http://www.djangoproject.com)" 
     244from django import get_version 
     245URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version() 
    245246 
    246247############## 
  • django/trunk/django/core/management.py

    r5355 r5451  
    44import django 
    55from django.core.exceptions import ImproperlyConfigured 
    6 import os, re, shutil, sys, textwrap 
    76from optparse import OptionParser 
    87from django.utils import termcolors 
     8import os, re, shutil, sys, textwrap 
    99 
    1010# For Python 2.3 
    1111if not hasattr(__builtins__, 'set'): 
    1212    from sets import Set as set 
     13 
     14# For backwards compatibility: get_version() used to be in this module. 
     15get_version = django.get_version 
    1316 
    1417MODULE_TEMPLATE = '''    {%% if perms.%(app)s.%(addperm)s or perms.%(app)s.%(changeperm)s %%} 
     
    9396# field as the field to which it points. 
    9497get_rel_data_type = lambda f: (f.get_internal_type() in ('AutoField', 'PositiveIntegerField', 'PositiveSmallIntegerField')) and 'IntegerField' or f.get_internal_type() 
    95  
    96 def get_version(): 
    97     "Returns the version as a human-format string." 
    98     from django import VERSION 
    99     v = '.'.join([str(i) for i in VERSION[:-1]]) 
    100     if VERSION[-1]: 
    101         v += '-' + VERSION[-1] 
    102     return v 
    10398 
    10499def get_sql_create(app): 
  • django/trunk/django/__init__.py

    r4914 r5451  
    11VERSION = (0, 97, 'pre') 
     2 
     3def get_version(): 
     4    "Returns the version as a human-format string." 
     5    v = '.'.join([str(i) for i in VERSION[:-1]]) 
     6    if VERSION[-1]: 
     7        v += '-' + VERSION[-1] 
     8    return v