Commit | Line | Data |
---|---|---|
01a9197e | 1 | # -*- encoding: utf-8 -*- |
2 | from django.db import models | |
03e081cb AJ |
3 | from datamaster_modeles.models import * |
4 | from savoirs.models import Discipline | |
01a9197e | 5 | |
6 | TYPE_SITE_CHOICES = ( | |
7 | ('RV', 'Revue en ligne'), | |
8 | ('BB', 'Bibliothèque en ligne'), | |
9 | ('FD', 'Fonds patrimonial'), | |
10 | ('AR', 'Archive ouverte'), | |
11 | ('CO', 'Cours en ligne'), | |
12 | ('AU', 'Autre type de site'), | |
13 | ) | |
14 | ||
15 | class Site(models.Model): | |
16 | """Fiche d'info d'un site web""" | |
17 | url = models.URLField(verify_exists=True) # dc:identifier (dc:source?) | |
03e081cb | 18 | titre = models.CharField(max_length=255, verbose_name='Titre') # dc.title |
01a9197e | 19 | description = models.TextField() |
03e081cb AJ |
20 | editeur = models.CharField(max_length=255, verbose_name='Éditeur') # dc.publisher : organisation resp |
21 | auteur = models.CharField(max_length=255, verbose_name='Auteur') # dc.creator : nom, prénom | |
22 | ||
23 | #auf_partenaire = models.BooleanField() # dc.contributor | |
24 | ||
01a9197e | 25 | date_publication = models.DateField() # dc.date : date de publication |
26 | type = models.CharField(max_length=2, null=False, blank=False, choices=TYPE_SITE_CHOICES, | |
27 | verbose_name = 'Type de site') # dc.type | |
03e081cb AJ |
28 | discipline = models.ManyToManyField(Discipline, blank=True) |
29 | thematique = models.ManyToManyField(Thematique, blank=True) | |
30 | ||
31 | mots_cles = models.TextField(verbose_name='Mots-clés') # dc:subject # indexation libre | |
01a9197e | 32 | |
33 | # source # dc:source (dc:relation?) | |
03e081cb | 34 | pays = models.ForeignKey(Pays, null = True, db_column='pays', to_field='code', verbose_name = 'Pays') |
01a9197e | 35 | |
36 | # meta | |
37 | actif = models.BooleanField() | |
03e081cb | 38 | date_maj = models.DateField(auto_now=True) |