Refs #27358 -- Removed invalid/unneeded FileField.upload_to in tests/docs.

This commit is contained in:
Tim Graham 2016-11-30 17:05:31 -05:00
parent ad8f6a45eb
commit e6262aaaf8
3 changed files with 6 additions and 6 deletions

View File

@ -330,7 +330,7 @@ your model explicitly. For example::
from django.contrib.sites.managers import CurrentSiteManager from django.contrib.sites.managers import CurrentSiteManager
class Photo(models.Model): class Photo(models.Model):
photo = models.FileField(upload_to='/home/photos') photo = models.FileField(upload_to='photos')
photographer_name = models.CharField(max_length=100) photographer_name = models.CharField(max_length=100)
pub_date = models.DateField() pub_date = models.DateField()
site = models.ForeignKey(Site, on_delete=models.CASCADE) site = models.ForeignKey(Site, on_delete=models.CASCADE)
@ -367,7 +367,7 @@ demonstrates this::
from django.contrib.sites.managers import CurrentSiteManager from django.contrib.sites.managers import CurrentSiteManager
class Photo(models.Model): class Photo(models.Model):
photo = models.FileField(upload_to='/home/photos') photo = models.FileField(upload_to='photos')
photographer_name = models.CharField(max_length=100) photographer_name = models.CharField(max_length=100)
pub_date = models.DateField() pub_date = models.DateField()
publish_on = models.ForeignKey(Site, on_delete=models.CASCADE) publish_on = models.ForeignKey(Site, on_delete=models.CASCADE)

View File

@ -3,13 +3,13 @@ from django.db import models
class PersonWithDefaultMaxLengths(models.Model): class PersonWithDefaultMaxLengths(models.Model):
email = models.EmailField() email = models.EmailField()
vcard = models.FileField(upload_to='/tmp') vcard = models.FileField()
homepage = models.URLField() homepage = models.URLField()
avatar = models.FilePathField() avatar = models.FilePathField()
class PersonWithCustomMaxLengths(models.Model): class PersonWithCustomMaxLengths(models.Model):
email = models.EmailField(max_length=250) 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) homepage = models.URLField(max_length=250)
avatar = models.FilePathField(max_length=250) avatar = models.FilePathField(max_length=250)

View File

@ -44,7 +44,7 @@ class EmailData(models.Model):
class FileData(models.Model): class FileData(models.Model):
data = models.FileField(null=True, upload_to='/foo/bar') data = models.FileField(null=True)
class FilePathData(models.Model): class FilePathData(models.Model):
@ -205,7 +205,7 @@ class EmailPKData(models.Model):
data = models.EmailField(primary_key=True) data = models.EmailField(primary_key=True)
# class FilePKData(models.Model): # class FilePKData(models.Model):
# data = models.FileField(primary_key=True, upload_to='/foo/bar') # data = models.FileField(primary_key=True)
class FilePathPKData(models.Model): class FilePathPKData(models.Model):