Skip to content

Commit cc0b082

Browse files
committed
Fixed documentation
1 parent f2b1dd2 commit cc0b082

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ Utils
104104
UploadToAutoSlugClassNameDir
105105
106106
107-
class MyClass(models.Model)
107+
class MyClass(models.Model):
108+
title = models.CharField(max_length=50)
109+
108110
# Gets saved to MEDIA_ROOT/myclass/#FILENAME#.#EXT#
109111
image1 = StdImageField(upload_to=UploadToClassNameDir())
110112
@@ -118,10 +120,10 @@ Utils
118120
image4 = StdImageField(upload_to=UploadToClassNameDirUUID())
119121
120122
# Gets save to MEDIA_ROOT/images/#SLUG#.#EXT#
121-
image5 = StdImageField(upload_to=UploadToAutoSlug(path='images))
123+
image5 = StdImageField(upload_to=UploadToAutoSlug(populate_from='title'))
122124
123125
# Gets save to MEDIA_ROOT/myclass/#SLUG#.#EXT#
124-
image6 = StdImageField(upload_to=UploadToAutoSlugClassNameDir())
126+
image6 = StdImageField(upload_to=UploadToAutoSlugClassNameDir(populate_from='title'))
125127
126128
Validators
127129
The `StdImageField` doesn't implement any size validation. Validation can be specified using the validator attribute

0 commit comments

Comments
 (0)