w
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

models.py
text/x-python

Download raw (1.0 KB)

from django.db import models
from django.contrib.postgres.fields import JSONField


class Score(models.Model):
    """docstring"""

    SCORE_TYPE_CHOICES = (
        (1, "transcription"),
        (2, "prescription"),
    )

    title = models.CharField(max_length=255)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    score_type = models.PositiveSmallIntegerField(default=1, choices=SCORE_TYPE_CHOICES)
    score_author = models.TextField(blank=True)
    performance_author = models.TextField(blank=True)
    presentation = models.TextField(blank=True)
    effectif = models.CharField(blank=True, max_length=255)
    stage_set = models.TextField(blank=True)
    duration = models.TextField(blank=True)
    genre = models.TextField(blank=True)
    tags = models.TextField(blank=True)
    mainline = JSONField(blank=True)


    def __str__(self):
        return self.title

    def get_absolute_url(self):
        return "/playground/score/#{}".format(self.id)

    class Meta:
        ordering = ['title']