File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ Basic example:
2727 from dynamic_filenames import FilePattern
2828
2929 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} '
3131 )
3232
3333 class FileModel (models .Model ):
@@ -107,7 +107,7 @@ Example:
107107 from dynamic_filenames import FilePattern
108108
109109 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} '
111111 )
112112
113113 class FileModel (models .Model ):
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class FilePattern:
6565 from django.db import models
6666 from dynamic_names import FilePattern
6767
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}')
6969
7070 class FileModel(models.Model):
7171 my_file = models.FileField(upload_to=upload_to_pattern)
@@ -93,7 +93,7 @@ class FileModel(models.Model):
9393 from dynamic_names import FilePattern
9494
9595 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}'
9797
9898 class FileModel(models.Model):
9999 title = models.CharField(max_length=100)
You can’t perform that action at this time.
0 commit comments