Source

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

Bases: database.models.custom_base_model.CustomBaseModel

A document containing the music defining a MusicalWork or a set of Sections or a set of Parts.

Must be part of a CollectionOfSources. If a CollectionOfSources contains only one Source, the Source is trivial but still must exist, i.e., an CollectionOfSources without at least one Source cannot exist.

A Source can be derived from a parent Source, implying a chain of provenance.

portion

models.CharField – A description of which portion of the CollectionOfSources this Source represents, for instance, page numbers or folio

collection

models.ForeignKey – Reference to the CollectionOfSources this Source belongs to

parent_source

models.ForeignKey – Reference to the Source this Source was derived from

child_sources

models.ManyToOneRel – References to Sources derived from this Source

Attributes Summary

child_sources Accessor to the related objects manager on the reverse side of a many-to-one relation.
collection Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
collection_id A wrapper for a deferred-loading field.
id A wrapper for a deferred-loading field.
objects
parent_source Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
parent_source_id A wrapper for a deferred-loading field.
portion A wrapper for a deferred-loading field.
source_instantiations Accessor to the related objects manager on the reverse side of a many-to-one 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

child_sources

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

collection

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.

collection_id

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

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

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.

parent_source_id

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

portion

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

source_instantiations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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)