Schemas
NonEmptyStr = Annotated[str, MinLen(1)]
module-attribute
¶
SimpleUserSchema
¶
Bases: ModelSchema
A schema with the minimum amount of information to represent a user.
UserProfileSchema
¶
Bases: ModelSchema
The necessary information to show a user profile
Album
¶
Bases: SasFile
NAME_MAX_LENGTH = 50
class-attribute
¶
Maximum length of an album's name.
SithFile have a maximum length of 256 characters. However, this limit is too high for albums. Names longer than 50 characters are harder to read and harder to display on the SAS page.
It is to be noted, though, that this does not add or modify any db behaviour. It's just a constant to be used in views and forms.
Picture
¶
Bases: SasFile
generate_thumbnails(*, img=None, save=False)
¶
Generate the thumbnail and the compressed version of this picture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
Image | None
|
if given, this will be used to generate |
None
|
save
|
bool
|
if True, save the instance in database. |
False
|
Source code in sas/models.py
rotate(degree)
¶
Rotate this picture and update its thumbnails accordingly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
degree
|
int | float
|
the rotation angle, in degree, counter-clockwise |
required |
Source code in sas/models.py
PictureModerationRequest
¶
Bases: Model
A request to remove a Picture from the SAS.
AlbumFilterSchema
¶
Bases: FilterSchema
SimpleAlbumSchema
¶
Bases: ModelSchema
AlbumSchema
¶
Bases: ModelSchema
AlbumAutocompleteSchema
¶
Bases: ModelSchema
Schema to use on album autocomplete input field.
PictureFilterSchema
¶
Bases: FilterSchema
PictureSchema
¶
Bases: ModelSchema
PictureRelationCreationSchema
¶
Bases: Schema
IdentifiedUserSchema
¶
Bases: Schema
ModerationRequestSchema
¶
Bases: ModelSchema