mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Fixed #4517 -- Made sure that URL_VALIDATOR_USER_AGENT includes the up-to-date
Django version number. Thanks, James Wheare. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5451 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6fc10f50b0
commit
130c7eee80
1
AUTHORS
1
AUTHORS
@ -234,6 +234,7 @@ answer newbie questions, and generally made Django that much better:
|
||||
wangchun <yaohua2000@gmail.com>
|
||||
Dan Watson <http://theidioteque.net/>
|
||||
Chris Wesseling <Chris.Wesseling@cwi.nl>
|
||||
James Wheare <django@sparemint.com>
|
||||
charly.wilhelm@gmail.com
|
||||
Rachel Willmer <http://www.willmer.com/kb/>
|
||||
Gary Wilson <gary.wilson@gmail.com>
|
||||
|
@ -1 +1,8 @@
|
||||
VERSION = (0, 97, 'pre')
|
||||
|
||||
def get_version():
|
||||
"Returns the version as a human-format string."
|
||||
v = '.'.join([str(i) for i in VERSION[:-1]])
|
||||
if VERSION[-1]:
|
||||
v += '-' + VERSION[-1]
|
||||
return v
|
||||
|
@ -241,7 +241,8 @@ TRANSACTIONS_MANAGED = False
|
||||
|
||||
# The User-Agent string to use when checking for URL validity through the
|
||||
# isExistingURL validator.
|
||||
URL_VALIDATOR_USER_AGENT = "Django/0.96pre (http://www.djangoproject.com)"
|
||||
from django import get_version
|
||||
URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version()
|
||||
|
||||
##############
|
||||
# MIDDLEWARE #
|
||||
|
@ -3,14 +3,17 @@
|
||||
|
||||
import django
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
import os, re, shutil, sys, textwrap
|
||||
from optparse import OptionParser
|
||||
from django.utils import termcolors
|
||||
import os, re, shutil, sys, textwrap
|
||||
|
||||
# For Python 2.3
|
||||
if not hasattr(__builtins__, 'set'):
|
||||
from sets import Set as set
|
||||
|
||||
# For backwards compatibility: get_version() used to be in this module.
|
||||
get_version = django.get_version
|
||||
|
||||
MODULE_TEMPLATE = ''' {%% if perms.%(app)s.%(addperm)s or perms.%(app)s.%(changeperm)s %%}
|
||||
<tr>
|
||||
<th>{%% if perms.%(app)s.%(changeperm)s %%}<a href="%(app)s/%(mod)s/">{%% endif %%}%(name)s{%% if perms.%(app)s.%(changeperm)s %%}</a>{%% endif %%}</th>
|
||||
@ -93,14 +96,6 @@ def _get_sequence_list():
|
||||
# field as the field to which it points.
|
||||
get_rel_data_type = lambda f: (f.get_internal_type() in ('AutoField', 'PositiveIntegerField', 'PositiveSmallIntegerField')) and 'IntegerField' or f.get_internal_type()
|
||||
|
||||
def get_version():
|
||||
"Returns the version as a human-format string."
|
||||
from django import VERSION
|
||||
v = '.'.join([str(i) for i in VERSION[:-1]])
|
||||
if VERSION[-1]:
|
||||
v += '-' + VERSION[-1]
|
||||
return v
|
||||
|
||||
def get_sql_create(app):
|
||||
"Returns a list of the CREATE TABLE SQL statements for the given app."
|
||||
from django.db import get_creation_module, models
|
||||
|
Loading…
Reference in New Issue
Block a user