TextFile

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

Bases: database.models.file.File

A manifestation of a SourceInstantiation as an digital text file.

Manifests one and only one SourceInstantiation.

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

file_type

models.CharField – The format of this TextFile

file_size

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

version

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

encoding_date

models.DateTimeField – The date this TextFile was encoded

encoded_with

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

validated_by

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

extra_metadata

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

manifests

models.ForeignKey – The SourceInstantiation manifested by this TextFile

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.
languages 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
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.

languages

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>
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)