mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #2827 -- Reverted [3855]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -820,8 +820,7 @@ def get_validation_errors(outfile, app=None): | ||||
|     validates all models of all installed apps. Writes errors, if any, to outfile. | ||||
|     Returns number of errors. | ||||
|     """ | ||||
|     from django.conf import settings | ||||
|     from django.db import models, connection | ||||
|     from django.db import models | ||||
|     from django.db.models.loading import get_app_errors | ||||
|     from django.db.models.fields.related import RelatedObject | ||||
|  | ||||
| @@ -863,12 +862,6 @@ def get_validation_errors(outfile, app=None): | ||||
|             if f.db_index not in (None, True, False): | ||||
|                 e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name) | ||||
|  | ||||
|             # Check that maxlength <= 255 if using older MySQL versions. | ||||
|             if settings.DATABASE_ENGINE == 'mysql': | ||||
|                 db_version = connection.get_server_version() | ||||
|                 if db_version < (5, 0, 3) and isinstance(f, (models.CharField, models.CommaSeparatedIntegerField, models.SlugField)) and f.maxlength > 255: | ||||
|                     e.add(opts, '"%s": %s cannot have a "maxlength" greater than 255 when you are using a version of MySQL prior to 5.0.3 (you are using %s).' % (f.name, f.__class__.__name__, '.'.join(str(n) for n in db_version[:3]))) | ||||
|  | ||||
|             # Check to see if the related field will clash with any | ||||
|             # existing fields, m2m fields, m2m related objects or related objects | ||||
|             if f.rel: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user