summaryrefslogtreecommitdiff
path: root/django/core/management.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-09-05 15:04:20 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-09-05 15:04:20 +0000
commite5a801590a062afaafa393bfc544c4441fea4362 (patch)
treec9d37c33f8ccc8ff77121993db1eb6c392acb065 /django/core/management.py
parent65bab4b824650548a29c775641431845c06f8a6f (diff)
Improved model validator to check for upload_to attribute in FileFields
git-svn-id: http://code.djangoproject.com/svn/django/trunk@622 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/management.py')
-rw-r--r--django/core/management.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/core/management.py b/django/core/management.py
index 7c56536ec2..3b6fe36378 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -520,6 +520,8 @@ def get_validation_errors(outfile):
for f in opts.fields:
if isinstance(f, meta.CharField) and f.maxlength in (None, 0):
e.add(opts, '"%s" field: CharFields require a "maxlength" attribute.' % f.name)
+ if isinstance(f, meta.FileField) and not f.upload_to:
+ e.add(opts, '"%s" field: FileFields require an "upload_to" attribute.' % f.name)
if f.prepopulate_from is not None and type(f.prepopulate_from) not in (list, tuple):
e.add(opts, '"%s" field: prepopulate_from should be a list or tuple.' % f.name)
if f.choices: