mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-13 14:16:04 +00:00
use typing.Self for custom queryset methods
This commit is contained in:
1 parent
d04b4c77c6
commit
6962b39fc9
3 files changed
+7
-7
No files matched your search
+3
-2
@@ -16,6 +16,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from io import BytesIO
|
||||
from typing import Self
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.cache import cache
|
||||
@@ -61,7 +62,7 @@ class SasFile(SithFile):
|
||||
|
||||
|
||||
class PictureQuerySet(models.QuerySet):
|
||||
def viewable_by(self, user: User) -> PictureQuerySet:
|
||||
def viewable_by(self, user: User) -> Self:
|
||||
"""Filter the pictures that this user can view.
|
||||
|
||||
Warnings:
|
||||
@@ -173,7 +174,7 @@ class Picture(SasFile):
|
||||
|
||||
|
||||
class AlbumQuerySet(models.QuerySet):
|
||||
def viewable_by(self, user: User) -> PictureQuerySet:
|
||||
def viewable_by(self, user: User) -> Self:
|
||||
"""Filter the albums that this user can view.
|
||||
|
||||
Warnings:
|
||||
|
||||
Reference in new issue
Block a user