Models Glossary
- class Media
A user created published work.
- thumb
A thumbnail image.
Automatically generated on save if the media is a video.
Whether or not the media is hidden.
- Type:
- Value:
False
- datetime_published
The date and time the user created the media.
Set on
Media.save(). Cannot be modified.- Type:
- Value:
now()
- set_thumbnail([file=None]) None
Sets the media’s thumbnail to the file.
If the file is
None, instead sets the media’s thumbnail to the return value ofgenerate_thumbnail().- Parameters:
file (
File) – The new thumbnail.- Returns:
Nothing.
- Return type:
- Raises:
AssertionError – If the media is an image.
- generate_thumbnail([loc=0]) File
Generates a thumbnail at frame
loc.- Parameters:
loc (
int) – The frame of the media to generate. Default is0.- Returns:
A new thumbnail file.
- Return type:
- Raises:
AssertionError – If the media is an image.
ValueError – If frame
locwas not captured.