API Media Properties¶
This document is auto-generated from the source code in /api/api/management/commands/documentmedia.py.
This is a list of the media properties, with the descriptions of corresponding database columns and Python objects that are used to store and retrieve media data.
General notes¶
The columns are sorted alphabetically and separated into relations (used to establish relationships to other models) and values (used to hold some data value). Note that relation fields are always nullable.
Models:
Audio¶
Relations¶
Name |
Type |
DB type |
Nature |
To |
|---|---|---|---|---|
|
One To Many |
|
||
Many To Many |
|
|||
|
One To Many |
|
||
|
Many To One |
|
||
|
One To One |
|
||
Many To Many |
|
|||
|
One To One |
|
Values¶
Name |
Type |
DB type |
Constraints |
Default |
|---|---|---|---|---|
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
not null |
||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
not blank |
|||
|
not null; unique; primary key |
|||
|
not null; not blank; unique |
|||
|
||||
|
not null; not blank |
|||
|
||||
|
||||
|
||||
|
not null; not blank |
|
||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
not null |
||
|
unique |
|||
|
|
|||
|
Notes¶
alt_files¶
Help text: JSON object containing information on alternative audio files. Each object is expected to contain:
url: URL reference to the filefilesize: File size in bytesfiletype: Extension of the filebit_rate: Bitrate of the file in bits/secondsample_rate: Sample rate of the file in bits/second
audio_report¶
AudioReport docstring: User-submitted reports of audio tracks.
AudioDecision is populated only if moderators have made a decision for this
report.
audio_set_foreign_identifier¶
Help text: Reference to set of which this track is a part.
audio_set_position¶
Help text: Ordering of the audio in the set.
audiodecision¶
AudioDecision docstring: Moderation decisions taken for audio tracks.
audiodecisionthrough¶
AudioDecisionThrough docstring: Many-to-many reference table for audio
decisions.
This is made explicit (rather than using Django’s default) so that the audio can
be referenced by identifier rather than an arbitrary id.
audioset¶
This is a virtual foreign-key to AudioSet built on top of the fields
audio_set_foreign_identifier and provider.
AudioSet docstring: This is an ordered collection of audio files, such as
a podcast series or an album.
Not to be confused with AudioList which is a many-to-many collection of audio
files, like a playlist or favourites library.
The FileMixin inherited by this model refers not to audio but album art.
bit_rate¶
Help text: Number in bits per second, eg. 128000.
category¶
Help text: The top-level classification of this media file.
creator¶
Help text: The name of the media creator.
creator_url¶
Help text: A direct link to the media creator.
deleted_audio¶
DeletedAudio docstring: Audio tracks deleted from the upstream source.
Do not create instances of this model manually. Create an AudioReport instance
instead.
duration¶
Help text: The time length of the audio file in milliseconds.
filesize¶
Help text: Number in bytes, e.g. 1024.
filetype¶
Help text: The type of the file, related to the file extension.
foreign_identifier¶
Help text: The identifier provided by the upstream source.
foreign_landing_url¶
Help text: The landing page of the work.
genres¶
Help text: An array of audio genres such as rock, electronic for music
category, or politics, sport, education for podcast category
id¶
This is Django’s automatic primary key, used for models that do not define one explicitly.
identifier¶
Help text: Our unique identifier for an open-licensed work.
last_synced_with_source¶
Help text: The date the media was last updated from the upstream source.
license¶
Help text: The name of license for the media.
license_version¶
Help text: The version of the media license.
lists¶
AudioList docstring: A list of audio files. Currently unused.
meta_data¶
Help text: JSON object containing extra data about the media item. No fields
are expected, but if the license_url field is available, it will be used for
determining the license URL for the media item. The description field, if
available, is also indexed into Elasticsearch and as a search field on queries.
provider¶
Help text: The content provider, e.g. Flickr, Jamendo…
removed_from_source¶
Help text: Whether the media has been removed from the upstream source.
sample_rate¶
Help text: Number in hertz, eg. 44100.
sensitive_audio¶
SensitiveAudio docstring: Audio tracks with verified sensitivity reports.
Do not create instances of this model manually. Create an AudioReport instance
instead.
source¶
Help text: The source of the data, meaning a particular dataset. Source and provider can be different. Eg: the Google Open Images dataset is source=openimages, but provider=flickr.
thumbnail¶
Help text: The thumbnail for the media.
title¶
Help text: The name of the media.
url¶
Help text: The actual URL to the media file.
view_count¶
Help text: Vestigial field, purpose unknown.
watermarked¶
Help text: Whether the media contains a watermark. Not currently leveraged.
Image¶
Relations¶
Name |
Type |
DB type |
Nature |
To |
|---|---|---|---|---|
|
One To One |
|
||
|
One To Many |
|
||
Many To Many |
|
|||
|
One To Many |
|
||
Many To Many |
|
|||
|
One To One |
|
Values¶
Name |
Type |
DB type |
Constraints |
Default |
|---|---|---|---|---|
|
||||
|
|
not null |
||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
not null; unique; primary key |
|||
|
not null; not blank; unique |
|||
|
||||
|
not null; not blank |
|||
|
||||
|
||||
|
||||
|
not null; not blank |
|
||
|
||||
|
||||
|
||||
|
||||
|
|
not null |
||
|
unique |
|||
|
|
|||
|
||||
|
Notes¶
category¶
Help text: The top-level classification of this media file.
creator¶
Help text: The name of the media creator.
creator_url¶
Help text: A direct link to the media creator.
deleted_image¶
DeletedImage docstring: Images deleted from the upstream source.
Do not create instances of this model manually. Create an ImageReport instance
instead.
filesize¶
Help text: Number in bytes, e.g. 1024.
filetype¶
Help text: The type of the file, related to the file extension.
foreign_identifier¶
Help text: The identifier provided by the upstream source.
foreign_landing_url¶
Help text: The landing page of the work.
height¶
Help text: The height of the image in pixels. Not always available.
id¶
This is Django’s automatic primary key, used for models that do not define one explicitly.
identifier¶
Help text: Our unique identifier for an open-licensed work.
image_report¶
ImageReport docstring: User-submitted report of an image.
This contains an ImageDecision as well, if moderators have made a decision for
this report.
imagedecision¶
ImageDecision docstring: Moderation decisions taken for images.
imagedecisionthrough¶
ImageDecisionThrough docstring: Many-to-many reference table for image
decisions.
This is made explicit (rather than using Django’s default) so that the image can
be referenced by identifier rather than an arbitrary id.
last_synced_with_source¶
Help text: The date the media was last updated from the upstream source.
license¶
Help text: The name of license for the media.
license_version¶
Help text: The version of the media license.
lists¶
ImageList docstring: A list of images. Currently unused.
meta_data¶
Help text: JSON object containing extra data about the media item. No fields
are expected, but if the license_url field is available, it will be used for
determining the license URL for the media item. The description field, if
available, is also indexed into Elasticsearch and as a search field on queries.
provider¶
Help text: The content provider, e.g. Flickr, Jamendo…
removed_from_source¶
Help text: Whether the media has been removed from the upstream source.
sensitive_image¶
SensitiveImage docstring: Images with verified sensitivity reports.
Do not create instances of this model manually. Create an ImageReport instance
instead.
source¶
Help text: The source of the data, meaning a particular dataset. Source and provider can be different. Eg: the Google Open Images dataset is source=openimages, but provider=flickr.
thumbnail¶
Help text: The thumbnail for the media.
title¶
Help text: The name of the media.
url¶
Help text: The actual URL to the media file.
view_count¶
Help text: Vestigial field, purpose unknown.
watermarked¶
Help text: Whether the media contains a watermark. Not currently leveraged.
width¶
Help text: The width of the image in pixels. Not always available.