File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ Basic example:
27
27
from dynamic_filenames import FilePattern
28
28
29
29
upload_to_pattern = FilePattern(
30
- filename_pattern = ' {app_name :.25 } /{model_name:.30 } /{uuid: base32}{ext} '
30
+ filename_pattern = ' {app_label :.25 } /{model_name:.30 } /{uuid: base32}{ext} '
31
31
)
32
32
33
33
class FileModel (models .Model ):
@@ -107,7 +107,7 @@ Example:
107
107
from dynamic_filenames import FilePattern
108
108
109
109
upload_to_pattern = FilePattern(
110
- filename_pattern = ' {app_name :.25 } /{model_name:.30 } /{instance.title: .40slug}{ext} '
110
+ filename_pattern = ' {app_label :.25 } /{model_name:.30 } /{instance.title: .40slug}{ext} '
111
111
)
112
112
113
113
class FileModel (models .Model ):
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class FilePattern:
65
65
from django.db import models
66
66
from dynamic_names import FilePattern
67
67
68
- upload_to_pattern = FilePattern('{app_name :.25}/{model_name:.30}/{uuid:.30base32}{ext}')
68
+ upload_to_pattern = FilePattern('{app_label :.25}/{model_name:.30}/{uuid:.30base32}{ext}')
69
69
70
70
class FileModel(models.Model):
71
71
my_file = models.FileField(upload_to=upload_to_pattern)
@@ -93,7 +93,7 @@ class FileModel(models.Model):
93
93
from dynamic_names import FilePattern
94
94
95
95
class TitleSlugPattern(FilePattern):
96
- filename_pattern = '{app_name :.25}/{model_name:.30}/{instance.title:slug}{ext}'
96
+ filename_pattern = '{app_label :.25}/{model_name:.30}/{instance.title:slug}{ext}'
97
97
98
98
class FileModel(models.Model):
99
99
title = models.CharField(max_length=100)
You can’t perform that action at this time.
0 commit comments