AudioFile

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

Bases: database.models.file.File

A manifestation of a Source as an digital audio file.

Manifests one and only one Source.

Generated by an Encoder and validated against a SourceInstantiation by a Validator.

file_type

models.CharField – The format of this AudioFile

file_size

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

version

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

encoding_date

models.DateTimeField – The date this AudioFile was encoded

encoded_with

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

validated_by

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

extra_metadata

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

length

models.PositiveIntegerField – The length of this AudioFile in seconds

recording_date

models.DateField – The date this AudioFile was recorded

manifests

ForeignKey – The SourceInstantiation manifested by this AudioFile

file

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

Attributes Summary

encoded_with Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
file The descriptor for the file attribute on the model instance.
id A wrapper for a deferred-loading field.
length A wrapper for a deferred-loading field.
manifests Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
manifests_id A wrapper for a deferred-loading field.
objects
recording_date A wrapper for a deferred-loading field.
validated_by Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

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

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.

file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world', 'r') as f:
...     instance.file = File(f)
id

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

length

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

manifests

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.

manifests_id

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

objects = <django.db.models.manager.Manager object>
recording_date

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

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.

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)