Schemas
ShortUvList = TypeAdapter(list[UtbmShortUvSchema])
module-attribute
¶
UV
¶
Bases: Model
Contains infos about an UV (course).
is_owned_by(user)
¶
can_be_viewed_by(user)
¶
has_user_already_commented(user)
¶
Help prevent multiples comments from the same user.
This function checks that no other comment has been posted by a specified user.
Returns:
Type | Description |
---|---|
bool
|
True if the user has already posted a comment on this UV, else False. |
Source code in pedagogy/models.py
UtbmShortUvSchema
¶
Bases: Schema
Short representation of an UV in the UTBM API.
Notes
This schema holds only the fields we actually need. The UTBM API returns more data than that.
WorkloadSchema
¶
Bases: Schema
SemesterUvState
¶
Bases: Schema
The state of the UV during either autumn or spring semester
UtbmFullUvSchema
¶
Bases: Schema
Long representation of an UV in the UTBM API.
SimpleUvSchema
¶
Bases: ModelSchema
Our minimal representation of an UV.
UvSchema
¶
Bases: ModelSchema
Our complete representation of an UV
UvFilterSchema
¶
Bases: FilterSchema
filter_search(value)
¶
Special filter for the search text.
It does a full text search if available.
Source code in pedagogy/schemas.py
filter_semester(value)
¶
Special filter for the semester.
If either "SPRING" or "AUTUMN" is given, UV that are available during "AUTUMN_AND_SPRING" will be filtered.