1
- from typing import Generic , Optional , Sequence , Type , TypeVar
1
+ from typing import Generic , Sequence , TypeVar
2
2
3
3
import django .db .models .options
4
4
from django .contrib .admin import AdminSite
@@ -24,7 +24,7 @@ class PrivateMediaMixin(Generic[_ModelT]):
24
24
in the admin URL configuration (automatically).
25
25
"""
26
26
27
- private_media_fields : Optional [ Sequence [str ]] = None
27
+ private_media_fields : Sequence [str ] | None = None
28
28
private_media_no_download_fields : Sequence [str ] = tuple ()
29
29
"""
30
30
A list of field names for which downloads are forbidden.
@@ -33,17 +33,17 @@ class PrivateMediaMixin(Generic[_ModelT]):
33
33
custom widget. You can block this by specifying the name of the field(s) that should
34
34
only be writable and not downloadable.
35
35
"""
36
- private_media_permission_required : Optional [ str ] = None
36
+ private_media_permission_required : str | None = None
37
37
private_media_view_class = PrivateMediaView
38
38
"""
39
39
The Django view class to use for private media field content download views.
40
40
"""
41
41
private_media_file_widget = PrivateFileWidget
42
42
# options passed through to sendfile, as a dict
43
- private_media_view_options : Optional [ dict ] = None
43
+ private_media_view_options : dict | None = None
44
44
45
45
admin_site : AdminSite
46
- model : Type [_ModelT ]
46
+ model : type [_ModelT ]
47
47
opts : django .db .models .options .Options
48
48
49
49
def get_private_media_fields (self ) -> Sequence [str ]:
0 commit comments