From e6262aaaf8066f2de8aadcc9561941ae64478cef Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 30 Nov 2016 17:05:31 -0500 Subject: [PATCH] Refs #27358 -- Removed invalid/unneeded FileField.upload_to in tests/docs. --- docs/ref/contrib/sites.txt | 4 ++-- tests/max_lengths/models.py | 4 ++-- tests/serializers/models/data.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/ref/contrib/sites.txt b/docs/ref/contrib/sites.txt index 668744a9c2..dc8ac87e80 100644 --- a/docs/ref/contrib/sites.txt +++ b/docs/ref/contrib/sites.txt @@ -330,7 +330,7 @@ your model explicitly. For example:: from django.contrib.sites.managers import CurrentSiteManager class Photo(models.Model): - photo = models.FileField(upload_to='/home/photos') + photo = models.FileField(upload_to='photos') photographer_name = models.CharField(max_length=100) pub_date = models.DateField() site = models.ForeignKey(Site, on_delete=models.CASCADE) @@ -367,7 +367,7 @@ demonstrates this:: from django.contrib.sites.managers import CurrentSiteManager class Photo(models.Model): - photo = models.FileField(upload_to='/home/photos') + photo = models.FileField(upload_to='photos') photographer_name = models.CharField(max_length=100) pub_date = models.DateField() publish_on = models.ForeignKey(Site, on_delete=models.CASCADE) diff --git a/tests/max_lengths/models.py b/tests/max_lengths/models.py index ec4cc8e114..3a0eee4078 100644 --- a/tests/max_lengths/models.py +++ b/tests/max_lengths/models.py @@ -3,13 +3,13 @@ from django.db import models class PersonWithDefaultMaxLengths(models.Model): email = models.EmailField() - vcard = models.FileField(upload_to='/tmp') + vcard = models.FileField() homepage = models.URLField() avatar = models.FilePathField() class PersonWithCustomMaxLengths(models.Model): email = models.EmailField(max_length=250) - vcard = models.FileField(upload_to='/tmp', max_length=250) + vcard = models.FileField(max_length=250) homepage = models.URLField(max_length=250) avatar = models.FilePathField(max_length=250) diff --git a/tests/serializers/models/data.py b/tests/serializers/models/data.py index 0deadc3795..9c44d97e6b 100644 --- a/tests/serializers/models/data.py +++ b/tests/serializers/models/data.py @@ -44,7 +44,7 @@ class EmailData(models.Model): class FileData(models.Model): - data = models.FileField(null=True, upload_to='/foo/bar') + data = models.FileField(null=True) class FilePathData(models.Model): @@ -205,7 +205,7 @@ class EmailPKData(models.Model): data = models.EmailField(primary_key=True) # class FilePKData(models.Model): -# data = models.FileField(primary_key=True, upload_to='/foo/bar') +# data = models.FileField(primary_key=True) class FilePathPKData(models.Model):