Parisson / Telemeta

Collaborative content management system for musicology
http://telemeta.org
GNU Affero General Public License v3.0
118 stars 38 forks source link

An independent table for Authorities #72

Open AnasGhrab opened 9 years ago

AnasGhrab commented 9 years ago

The management of Authorities (persons, organization) should be done through an independent table

yomguy commented 9 years ago

As users and groups are already managed by django itself, I think we could just add some more metadata to UserProfile and maybe new ones for work groups.

AnasGhrab commented 9 years ago

Authorities are not users of Telemeta. They are Composers/Singers/Musicians, etc. They are more like enumerations... but with more fields for them (first names,names, translitted names, names in other language, date of birth, date of death, etc.).

yomguy commented 9 years ago

Yes, sure we need more tables for the musical and editing parts of authorities. But, as they refer to real humans, we could maybe link them to the user table so that we don't have to double the basic fields (first, last name, adress, etc..).

AnasGhrab commented 9 years ago

We also need to link the person to a table (enumerations) of « functions » : a person can be a composer in a recording, an interpreter in another, an instrument player (here another information on the instrument), a recordist, a responsible on the field recording, a contributor, etc.

yomguy commented 9 years ago

That's right!

yomguy commented 8 years ago

CMAM + CREM liaisons vers les DB externes : viaf + ISNI + RAMEAU

josimonnot commented 8 years ago

RDA: http://metadataregistry.org/schemaprop/list/schema_id/4.html

josimonnot commented 8 years ago

Table personnes: Nom Prénom dates URL Table Rôles

AnasGhrab commented 8 years ago

A proposition of models, that I use with Django 1.9 :

class Fonction(models.Model):
        intitule = models.CharField(_('fonction'),max_length=50,null=True,blank=True)

        class Meta:
                managed = True
                db_table = 'media_fonctions'
                verbose_name = _('Fonction')
                verbose_name_plural = _('Fonctions')

        def __unicode__(self):              # __unicode__ on Python 2
                return '%s' % (self.intitule)

class Responsable(models.Model):
        item = models.ForeignKey(Item,verbose_name=_('Item'))
        # Can it be like this ?
        responsable = models.ForeignKey(User,verbose_name=_('responsable'))
        # Here from the Users, but it can be from another table Authority
        fonction = models.ForeignKey(Fonction,verbose_name=_('fonction'))

        class Meta:
                managed = True
                db_table = 'media_responsables'
                verbose_name = _('Mention de responsabilité')
                verbose_name_plural = _('Mentions de responsabilité')

        def __unicode__(self):              # __unicode__ on Python 2
                return '%s (%s) : %s' % (self.responsable, self.fonction, self.texte)

And then in admin.py

class ResponsableInline(admin.StackedInline):
    model = Responsable
    extra = 1

[...]

class ItemAdmin(admin.ModelAdmin):
[...]
        inlines = [ ResponsableInline, ]
AnasGhrab commented 8 years ago

Here is an example of an Authority model. To go toward an internationalisation, I propose three forms for the name (this is important) : 1. First and last name in latin characters (the widely known form); 2. First and last name in a translitteration using latin characters (that follows some standards Arabic : ISO 233-2:1993; Grec : ISO 843:1997; Hebrew : ISO 259-2:1994); 3. The First and last name in the original alphabet.

class Authority(models.Model):
    nom_lat = models.CharField(_('nom'),max_length=50,null=True,blank=True)
    prenom_lat = models.CharField(_('prenom'),max_length=100,null=True,blank=True)
    nom_trans = models.CharField(_('nom_trans'),max_length=40,null=True,blank=True)
    prenom_trans = models.CharField(_('prenom_trans'),max_length=80,null=True,blank=True)
    nom_origin = models.CharField(_('nom_trans'),max_length=40,null=True,blank=True)
    prenom_origin = models.CharField(_('prenom_trans'),max_length=80,null=True,blank=True)
    naiss_date = models.CharField(_('annee_naiss'),max_length=10,null=True,blank=True)
    deces_date = models.CharField(_('annee_deces'),max_length=10,null=True,blank=True)
    naiss_lieu = models.CharField(_('lieu_naiss'),max_length=20,null=True,blank=True)
    deces_lieu = models.CharField(_('lieu_deces'),max_length=20,null=True,blank=True)
    biographie = models.TextField(_('biographie'),null=True,blank=True)
    upload = # To upload a photo... 
    uri = # a link to an external database for authorities : http://isni.org/

    class Meta:
        managed = True
        db_table = 'media_authorities'
        verbose_name = _('Authority')
        verbose_name_plural = _('Authorities')

    def __unicode__(self):              # __unicode__ on Python 2
        return '%s %s' % (self.prenom, self.nom)