diff --git a/django/bin/compile-messages.py b/django/bin/compile-messages.py index c81a2caa29..e33fdd780b 100755 --- a/django/bin/compile-messages.py +++ b/django/bin/compile-messages.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import os import sys diff --git a/django/bin/make-messages.py b/django/bin/make-messages.py index 5c74faecbb..75b0bc0ca0 100755 --- a/django/bin/make-messages.py +++ b/django/bin/make-messages.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from django.utils.translation import templatize import re diff --git a/django/bin/unique-messages.py b/django/bin/unique-messages.py index e29f2b8deb..c601a9eeea 100755 --- a/django/bin/unique-messages.py +++ b/django/bin/unique-messages.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import os import sys diff --git a/django/core/management.py b/django/core/management.py index 48ea67b8a2..a69e6e6a7e 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -805,6 +805,10 @@ def inspectdb(db_name): if field_type == 'CharField' and row[3]: extra_params['maxlength'] = row[3] + if field_type == 'FloatField': + extra_params['max_digits'] = row[4] + extra_params['decimal_places'] = row[5] + # Add primary_key and unique, if necessary. column_name = extra_params.get('db_column', att_name) if column_name in indexes: diff --git a/django/core/validators.py b/django/core/validators.py index 377b55fb4f..0411437543 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -16,7 +16,7 @@ import re _datere = r'(19|2\d)\d{2}-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[12][0-9])|(?:3[0-1]))' _timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?' alnum_re = re.compile(r'^\w+$') -alnumurl_re = re.compile(r'^[\w/]+$') +alnumurl_re = re.compile(r'^[-\w/]+$') ansi_date_re = re.compile('^%s$' % _datere) ansi_time_re = re.compile('^%s$' % _timere) ansi_datetime_re = re.compile('^%s %s$' % (_datere, _timere)) @@ -62,7 +62,7 @@ def isAlphaNumeric(field_data, all_data): def isAlphaNumericURL(field_data, all_data): if not alnumurl_re.search(field_data): - raise ValidationError, gettext("This value must contain only letters, numbers, underscores and slashes.") + raise ValidationError, gettext("This value must contain only letters, numbers, underscores, dashes or slashes.") def isSlug(field_data, all_data): if not slug_re.search(field_data):