mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Migrates lookups
* products * files * Groups * Clubs * Accounting
This commit is contained in:
@ -8,7 +8,7 @@ from haystack.query import SearchQuerySet
|
||||
from ninja import FilterSchema, ModelSchema, Schema
|
||||
from pydantic import AliasChoices, Field
|
||||
|
||||
from core.models import User
|
||||
from core.models import Group, SithFile, User
|
||||
|
||||
|
||||
class SimpleUserSchema(ModelSchema):
|
||||
@ -45,6 +45,18 @@ class UserProfileSchema(ModelSchema):
|
||||
return obj.profile_pict.get_download_url()
|
||||
|
||||
|
||||
class SithFileSchema(ModelSchema):
|
||||
class Meta:
|
||||
model = SithFile
|
||||
fields = ["id", "name"]
|
||||
|
||||
|
||||
class GroupSchema(ModelSchema):
|
||||
class Meta:
|
||||
model = Group
|
||||
fields = ["id", "name"]
|
||||
|
||||
|
||||
class UserFilterSchema(FilterSchema):
|
||||
search: Annotated[str, MinLen(1)]
|
||||
exclude: list[int] | None = Field(
|
||||
|
Reference in New Issue
Block a user