Django MusicBrainz Connector
  • Area Type
  • Area
  • Artist Credit
  • Artist Credit Name
  • Artist Type
  • Artist
  • Gender
  • Language
  • Link
    • Link
  • Link Attribute
  • Link Attribute Text Value
  • Link Attribute Type
  • Link Text Attribute Type
  • Link Type
  • Medium Format
  • Recording
  • RecordingWorkLink
  • ReleaseGroupPrimaryType
  • ReleasePackaging
  • ReleaseStatus
  • Script
  • Tag
  • Track
  • Work
  • Work Type
  • Base tag model
  • Changelog
Django MusicBrainz Connector
  • Link
  • View page source

Link

class django_musicbrainz_connector.models.Link(*args, **kwargs)[source]

PostgreSQL Definition

The link table is defined in the MusicBrainz Server as:

CREATE TABLE link ( -- replicate
    id                  SERIAL,
    link_type           INTEGER NOT NULL, -- references link_type.id
    begin_date_year     SMALLINT,
    begin_date_month    SMALLINT,
    begin_date_day      SMALLINT,
    end_date_year       SMALLINT,
    end_date_month      SMALLINT,
    end_date_day        SMALLINT,
    attribute_count     INTEGER NOT NULL DEFAULT 0,
    created             TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    ended               BOOLEAN NOT NULL DEFAULT FALSE
    CONSTRAINT link_ended_check CHECK (
        (
        -- If any end date fields are not null, then ended must be true
        (end_date_year IS NOT NULL OR
        end_date_month IS NOT NULL OR
        end_date_day IS NOT NULL) AND
        ended = TRUE
        ) OR (
        -- Otherwise, all end date fields must be null
        (end_date_year IS NULL AND
        end_date_month IS NULL AND
        end_date_day IS NULL)
        )
    )
);
Previous Next

© Copyright 2025, Marios Zindilis.

Built with Sphinx using a theme provided by Read the Docs.