magic-removal: Merged to [2356]

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2357 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-02-18 23:06:03 +00:00
parent 9cb04f5fae
commit 6c9e2bc3f1
5 changed files with 9 additions and 5 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import sys

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
from django.utils.translation import templatize
import re

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import sys

View File

@ -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:

View File

@ -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):