Skip to content

BaseChant Model

Lucas edited this page Feb 2, 2024 · 56 revisions

BaseChant (code) is an abstract model in the main_app app. It inherits from BaseModel.

Both Chant and Sequence inherit from BaseChant: the two models must have the same fields. The reason is that we want both chants and sequences to appear in chant-search results and thus have to do a union operation on two querysets from the two models. Django allows us to do that only if they have the exact same fields. Thus, all fields, properties and attributes for both Chants and Sequences are declared in BaseChant in order to keep the two models' fields harmonized, even when only one of the two models uses a particular field.

Fields

  • visible_status: corresponds to the "status" field in OldCantus. It is not used in NewCantus, because whether a chant/sequence is visible to non-logged-in users is controlled by a chant/sequence's Source's published field.
  • title: This field is used only for Sequences. When migrating data from OldCantus to NewCantus, this field corresponds to the OldCantus "title" field.
  • incipit: A short string storing the first few words of a chant ("incipit" means "it begins" in Latin). When migrating data from OldCantus to NewCantus, for chants, this field corresponds to the OldCantus "title" field. For sequences, this field corresponds to the OldCantus "incipit" field.
  • siglum: A string. Appears to duplicate the chant's Source's siglum
  • folio: the folio of a manuscript the chant/sequence in question can be found on (colloquially, which page the chant/sequence is on). A folio value usually takes the form of three numeric digits followed by an r or v (for example, 012v) though other formats exist. In the standard format, the three numeric digits indicate the leaf, and r ("recto") indicates the chant/sequence is on the front of that leaf while v ("verso") indicates it is on the back of the leaf.
  • s_sequence: This field is used only for Sequences, where it represents the relative position of a Sequence in a manuscript (This is a carry-over from the Bower Sequence database, which used a different convention for indicating the locations of sequences than the convention followed in the Cantus Database proper; see c_sequence below). It occasionally includes leading zeroes and/or leading/trailing non-numeric characters, so it is a CharField rather than a PositiveIntegerField. Previously called sequence.
    • Nota bene: "s_sequence" should only ever be used internally. On any outward-facing view/API/page, use "Sequence" where you might otherwise be tempted to use "S sequence"
  • c_sequence: This field is used only for Chants, where it represents the relative position of a Chant on a folio. In contrast to the s_sequence property, c_sequence is always an integer, so it is a PositiveIntegerField. Previously called sequence_number.
    • The first complete chant on a folio is given a c_sequence of 1, and successive chants are given successive numbers, so usually c_sequence >= 1. However, a chant is occasionally assigned a c_sequence of 0 if it is an incomplete chant that begins a fragment. For this reason, make sure to check if c_sequence is not None rather than if c_sequence.
    • Nota bene: "c_sequence" should only ever be used internally. On any outward-facing view/API/page, use "Sequence" where you might otherwise be tempted to use "C sequence"
  • genre: A ForeignKey field, pointing to a Genre object
  • rubrics Used only for Sequences. A string; it appears to be a transcription of text written in red ink immediately before the sequence begins in the manuscript. Examples: "De sancto matheo evengelesta et ceteris evangelistis. Sequencia", "In die sancti nicholai episcopi ad missam sequencia", "Prosa de sancto Laurentio"
  • analecta_hymnica: Used only for Sequences. A string, usually a series of numeric digits, a colon, and more digits. Seems to represent volume:page# pairs in the Analecta Hymnica Medii Aevi
  • indexing_notes: A string, used to "record any questions, comments, or information while you are indexing" (for more information, see Fields and Content Descriptions > Indexing Notes).
  • date: Used only for Sequences. A short string. Examples: "13c/es", "13b/es", "15b/d-sn", "14a/ds"
  • col1, col2, col3: These fields are used only for Sequences. No one is exactly sure what they do - the seem to have been inherited from the Bower Sequence Database.
  • ah_volume: Used only for Sequences. A string, usually one or two numeric digits. Generally matches the first half of the analecta_hymnica field.
  • source: A ForeignKey field, pointing to a Source object. Since chants in OldCantus sometimes do not include a source, source is optional.
  • cantus_id: a short string, usually consisting of six numeric digits (for example, 007450), but occasionally including several pre/appended non-numeric characters (for example, 007840b); additional rare variants on these formats also exist (for example, a02856.1). Cantus IDs allow researchers to compare similar chants in different manuscripts. For nearly every Cantus ID, a canonic version of the chant is stored on Cantus Index (see, for example, http://cantusindex.org/id/a02856.1), though there exist a couple of exceptions (e.g., 900000 for illegible chants, 909999 for ambiguous chants)
  • image_link: a url to a digital image archive storing the image of the folio or page the chant is located on.
  • json_info: stores a json object encoding all the information from OldCantus on a given chant/sequence. This field is populated by the sync_chants and sync_sequences management commands as they pull data from OldCantus's json-node API.
  • marginalia: a short string that is "utilized in some records to clarify the location of a chant on the page or folio". For more information, see Fields and Content Descriptions > Marginalia, Other Information.
  • office: A ForeignKey field, pointing to an Office object. Represents the chant's liturgical occasion.
  • position: A string that "identifies the liturgical role of a particular chant"; for more information, see Fields and Content Descriptions > Position.
  • feast: A ForeignKey field, pointing to a Feast object
  • mode: A short string indicating the mode of a chant/sequence (a chant/sequence's mode efficiently encodes both its final note as well as its approximate range). For more information, see Fields and Content Description > Mode
  • differentia: A short string describing a chant's differentia. (neumes that follow certain chants that indicate the melodic formula used to sing the following piece of music in a service, often written above the letters "euouae", an abbreviation of "seculorum amen". For more information, see Fields and Content Descriptions > Differentia)
  • differentiae_database: A string which is the ID of the chant's differentia on https://differentiaedatabase.ca. Note: This field is currently not being used or displayed in the database. We are now using the diff_db field for the same purpose.
  • diff_db: A ForeignKey field, pointing to a Differentia object. Represents the ID and volpiano transcription of the chant's differentia on https://differentiaedatabase.ca.
  • finalis: a single uppercase character indicating the final note of a chant/sequence
  • extra: a string: "When an indexer desires to include non-standard information in a file, it can be placed in this field". (For more information, see Fields and Content Descriptions > Extra)
  • chant_range: a short string of volpiano encoding a chant/sequence's lowest and highest notes
  • addendum: a string, containing "extra information not normally included in the Cantus format" such as concordance information and psalm usages. For more information, see Fields and Content Descriptions > Addendum.
  • manuscript_full_text_std_spelling: stores a standardized version of a chant/sequence's text. Since latin spelling varied from place to place and from century to century, this field stores a version of the text using classical latin spellings of words, allowing researchers to search for chants/sequences containing a given word without having to worry about variant spellings. Compare to the manuscript_full_text field below.
  • manuscript_full_text_std_proofread: a boolean value indicating whether a chant/sequence's manuscript_full_text_std_spelling has been proofread
  • manuscript_full_text: stores the text of a chant/sequence, as it appears in the manuscript. Compare to the manuscript_full_text_std_spelling field above.
  • manuscript_full_text_proofread: a boolean value indicating whether a chant/sequence's manuscript_full_text has been proofread
  • manuscript_syllabized_full_text: an optional field storing a syllabized version of manuscript_full_text_proofread. It is manually set by contributors in the ChantEditSyllabificationView in situations where the syllables of a chant are not automatically parsed correctly when rendering a chant/sequence's volpiano along with its syllables.
  • volpiano: a string encoding the pitches to which the words of a chant are sung. See Volpiano.
  • volpiano_proofread: a boolean value indicating whether a chant's volpiano has been proofread
  • volpiano_notes: a standardized version of volpiano, with extraneous characters (such as clefs, accidentals, spaces and barlines) removed, repeated notes reduced to single notes, and characters indicating liquescent neumes converted to their non-liquescent version. volpiano_notes is used in MelodySearchView.
  • volpiano_intervals: a string encoding the melodic intervals implied by a chant's volpiano_notes
  • cao_concordances: Nota Bene: Debra has stated that this field may contain out-of-date information, so should not be displayed in any public-facing views. It is currently being retained so we don't need to remove data from the database; the medium- to long-term plan is for this data to be stored in Cantus Index rather than in Cantus Database.
    • CAO is an abbreviation of Corpus Antiphonalium Officii - a published/printed catalog of texts for antiphons. Debra notes that "If a Cantus ID begins with '00', then the next 4 digits are its CAO number. The chants that we have found since have different formats of numbering, so they will have no concordances in CAO."
  • proofread_by: A ManyToMany field, pointing to one or more User objects, indicating which users have proofread the chant.
  • melody_id: similar to cantus_id above, a chant/sequence's Melody ID allows researchers to compare chants/sequences with similar melodies. Most Melody IDs consist of a Cantus ID, followed by an m, followed by a single numeric digit (for example, 001216m1) Canonic versions of melodies can be found on Cantus Index (for example, http://cantusindex.org/melody/001216m1)
  • search_vector: used in views.chants.keyword_search (code) to optimize search functionality. update_chant_search_vector() in signals.py should keep this field up-to-date as chants in the database are added/modified; the search vectors for all chants in the database can be updated by running the populate_chant_fields management command.
  • content_structure: Used only for Chants. A short string. Seems to be used to store similar information to the folio field (perhaps used in cases where manuscripts have come apart and have been re-bound in a different order?). Examples: "053v", "104", "verso", "2r", "002v7"
  • next_chant (only used for Chants): the chant that immediately follows this chant in a source. next_chant facilitates the operation of several functions, saving the value of the .get_next_chant() Chant method so that it does not need to be calculated on the fly. Its value is populated by the populate_next_chant_fields (code) management command.
  • prev_chant (only used for Chants): a given chant's prev_chant is automatically set when another chant's next_chant points to the given chant.
  • is_last_chant_in_feast: used only for Chants. This boolean field is used to optimize the .get_suggested_feasts() function in the chant-create view. It is populated using the populate_is_last_chant_in_feast (code) management command.
  • inherited from BaseModel:
    • date_created
    • date_updated
    • created_by
    • last_updated_by

Methods

  • inherited from BaseModel:
    • save()
    • display_name (property)
    • get_absolute_url()
    • get_verbose_name()
    • get_verbose_name_plural()
    • get_fields_and_properties()