formatted :)

This commit is contained in:
Андрей Сумин
2025-03-02 16:45:11 +03:00
parent 7032ba2770
commit b30f0c7df2
18 changed files with 174 additions and 100 deletions
@@ -1,4 +1,4 @@
from ninja import ModelSchema, Schema
from ninja import ModelSchema
from apps.achievement.models import Achievement
@@ -6,4 +6,9 @@ from apps.achievement.models import Achievement
class AchievementSchema(ModelSchema):
class Meta:
model = Achievement
fields = ("id", "name", "description", "icon",)
fields = (
"id",
"name",
"description",
"icon",
)
+2 -2
View File
@@ -2,9 +2,9 @@ from http import HTTPStatus as status
from ninja import Router
from apps.achievement.models import Achievement
from api.v1.achievement.schemas import AchievementSchema
from api.v1.schemas import UnauthorizedError
from apps.achievement.models import Achievement
router = Router()
@@ -14,7 +14,7 @@ router = Router()
response={
status.OK: list[AchievementSchema],
status.UNAUTHORIZED: UnauthorizedError,
}
},
)
def get_all_achievements(request):
return Achievement.objects.all()