File

class database.models.File(*args, **kwargs)

Bases: database.models.custom_base_model.CustomBaseModel

Base abstract model with fields common to all file types.

Most if not all fields should be extracted automatically

file_type

models.CharField – The format of this File

file_size

models.PositiveIntegerField – The size of the this File in bytes

version

models.CharField – The version of the encoding schema of this File

encoding_date

models.DateTimeField – The date this File was encoded

encoded_with

models.ForeignKey – A reference to the Encoder of this File

validated_by

models.ForeignKey – A reference to the Validator of this File

extra_metadata

django.contrib.postgres.fields.JSONField – Any extra metadata associated with this File

manifests

None – Subclasses must override

file

models.FileField – The path to the actual file stored on disk

Attributes Summary

certainty Return the certainty of the MusicalWork related to this File
composers Return the composers of the MusicalWork related to this File
composers_dates Return the dates of the MusicalWork related to this File
composers_locations Return the places of the MusicalWork related to this File
encoded_with Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
encoded_with_id A wrapper for a deferred-loading field.
encoding_date A wrapper for a deferred-loading field.
extra_metadata A wrapper for a deferred-loading field.
file_size A wrapper for a deferred-loading field.
file_type A wrapper for a deferred-loading field.
genres_as_in_style Return the Genres (style) of the MusicalWork related to this File
genres_as_in_type Return the Genres (type) of the MusicalWork related to this File
instrumentation Return the Instruments of the MusicalWork related to this File
manifests
musical_work Return the MusicalWork the Source of this File is related to
parts Return the Parts manifested in full by the Source of this File
sacred_or_secular Return the _sacred_or_secular of the MusicalWork related to this file
sections Return the Sections manifested in full by the Source of this File
source Return the Source of this File
validated_by Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
validated_by_id A wrapper for a deferred-loading field.
version A wrapper for a deferred-loading field.

Methods Summary

get_next_by_date_created(*[, field, is_next])
get_next_by_date_updated(*[, field, is_next])
get_previous_by_date_created(*[, field, is_next])
get_previous_by_date_updated(*[, field, is_next])

Attributes Documentation

certainty

Return the certainty of the MusicalWork related to this File

Returns:The certainty of attribution of the MusicalWork related to this File
Return type:bool
composers

Return the composers of the MusicalWork related to this File

Returns:A list of strings representing the names of the composers
Return type:list
composers_dates

Return the dates of the MusicalWork related to this File

Returns:A list of date tuples representing the date ranges of composition
Return type:list
composers_locations

Return the places of the MusicalWork related to this File

Returns:A QuerySet of GeographicAreas where the Musical Work related to this File was composed
Return type:QuerySet
encoded_with

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

encoded_with_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

encoding_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

extra_metadata

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file_size

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

genres_as_in_style

Return the Genres (style) of the MusicalWork related to this File

Returns:The Genres (style) of the MusicalWork related to this File
Return type:QuerySet
genres_as_in_type

Return the Genres (type) of the MusicalWork related to this File

Returns:The Genres (type) of the MusicalWork related to this File
Return type:QuerySet
instrumentation

Return the Instruments of the MusicalWork related to this File

Returns:A QuerySet of all the Instruments of the MusicalWork related to this File
Return type:QuerySet
manifests = None
musical_work

Return the MusicalWork the Source of this File is related to

Returns:The MusicalWork the Source of this File is related to
Return type:MusicalWork
parts

Return the Parts manifested in full by the Source of this File

Returns:A QuerySet of all the Parts the Source of this File is related to
Return type:QuerySet
sacred_or_secular

Return the _sacred_or_secular of the MusicalWork related to this file

Returns:The _sacred_or_secular of the MusicalWork related to this file
Return type:str
sections

Return the Sections manifested in full by the Source of this File

Returns:A QuerySet of all the Sections the Source of this File is related to
Return type:QuerySet
source

Return the Source of this File

Returns:The Source of this File
Return type:Source
validated_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

validated_by_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

version

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Methods Documentation

get_next_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)
get_next_by_date_updated(*, field=<django.db.models.fields.DateTimeField: date_updated>, is_next=True, **kwargs)
get_previous_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)
get_previous_by_date_updated(*, field=<django.db.models.fields.DateTimeField: date_updated>, is_next=False, **kwargs)