src/p4l/models/data.py
author cavaliet
Mon, 02 Sep 2013 16:40:28 +0200
changeset 19 6b45fd23e4a0
parent 17 b31a67614f76
child 62 8433e12362e0
permissions -rw-r--r--
update models without labels and acronyms
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
# -*- coding: utf-8 -*-
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
from django.db import models
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
from p4l.models.common import P4lModel, P4lModelLang
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
class Imprint(P4lModelLang):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    record = models.ForeignKey('p4l.Record', related_name="imprints")
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
    imprintCity = models.CharField(max_length=512, blank=True, null=True, db_index=True)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    publisher = models.CharField(max_length=512, blank=True, null=True, db_index=True)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    imprintDate = models.CharField(max_length=512, blank=True, null=True, db_index=True)    
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    14
class Serie(P4lModelLang):
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    15
    record = models.ForeignKey('p4l.Record', related_name="series")
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
    title = models.CharField(max_length=2048, blank=False, null=False, db_index=True)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    volume = models.CharField(max_length=2048, blank=True, null=True, db_index=True)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
class ProjectName(P4lModel):
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
    21
    uri = models.URLField(max_length=2048, unique=True, db_index=True) 
19
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    22
#    label = models.CharField(max_length=2048, blank=False, null=False, db_index=True)
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    23
#    acronym = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:acronym        # 
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    24
#    class Meta(P4lModel.Meta):
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    25
#        unique_together = ['label', 'acronym']
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
class CorporateAuthor(P4lModel):
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
    29
    uri = models.URLField(max_length=2048, unique=True, db_index=True)
19
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    30
#    label = models.CharField(max_length=2048, blank=True, null=True, db_index=True)
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    31
#    acronym = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:acronym    
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    32
#    class Meta(P4lModel.Meta):
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    33
#        unique_together = ['label','acronym']
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
class Url(P4lModel):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    36
    record = models.ForeignKey('p4l.Record', related_name="urls", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
    address = models.CharField(max_length=2048, blank=False, null=False, db_index=True) #iiep:address
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
    display = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:display
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
    accessLevel = models.CharField(max_length=512, blank=True, null=True, db_index=True) #iiep:accessLevel
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
class Subject(P4lModel):
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
    43
    uri = models.URLField(max_length=2048, unique=True, db_index=True)
19
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    44
    #label = models.CharField(max_length=2048, blank=True, null=True, db_index=True) # filled from sparql request after import
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
class Theme(P4lModel):
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
    47
    uri = models.URLField(max_length=2048, unique=True, db_index=True)
19
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    48
    #label = models.CharField(max_length=2048, blank=True, null=True, db_index=True) # filled from sparql request after import
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
class Country(P4lModel):
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
    52
    uri = models.URLField(max_length=2048, unique=True, db_index=True)
19
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    53
    #label = models.CharField(max_length=2048, blank=True, null=True, db_index=True) # filled from sparql request after import
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
class Isbn(P4lModelLang):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    57
    record = models.ForeignKey('p4l.Record', related_name="isbns", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
    isbn = models.CharField(max_length=128) #iiep:isbn
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
class Issn(P4lModelLang):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    62
    record = models.ForeignKey('p4l.Record', related_name="issns", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
    issn = models.CharField(max_length=128) #iiep:issn
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
class DocumentCode(P4lModelLang):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    66
    record = models.ForeignKey('p4l.Record', related_name="documentCodes", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
    documentCode = models.CharField(max_length=128) #iiep:issn
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
class Language(P4lModel):
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
    70
    uri = models.URLField(max_length=2048, unique=True, db_index=True)
19
6b45fd23e4a0 update models without labels and acronyms
cavaliet
parents: 17
diff changeset
    71
    #label = models.CharField(max_length=2048, blank=True, null=True, db_index=True) # filled from sparql request after import
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
class BaseTitle(P4lModelLang):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
    title = models.CharField(max_length=2048, blank=False, null=False, db_index=True)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
    class Meta(P4lModelLang.Meta):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
        abstract = True
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
class Title(BaseTitle):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    79
    record = models.ForeignKey('p4l.Record', related_name="titles", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
class AddedTitle(BaseTitle):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    82
    record = models.ForeignKey('p4l.Record', related_name="addedTitles", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
class TitleMainDocument(BaseTitle):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    85
    record = models.ForeignKey('p4l.Record', related_name="titlesMainDocument", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
class Abstract(P4lModelLang):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    89
    record = models.ForeignKey('p4l.Record', related_name="abstracts", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
    abstract = models.TextField(blank=True, null=True)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
class Collation(P4lModelLang):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    94
    record = models.ForeignKey('p4l.Record', related_name="collations", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
    collation = models.CharField(max_length=1024, blank=False, null=False, db_index=True)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
class VolumeIssue(P4lModelLang):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
    99
    record = models.ForeignKey('p4l.Record', related_name="volumeIssues", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
    volume = models.CharField(max_length=1024, blank=True, null=True, db_index=True) #iiep:volume
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
    number = models.CharField(max_length=1024, blank=True, null=True, db_index=True) #iiep:number
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
class P4lPerson(P4lModel):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   105
    name = models.CharField(max_length=2048, blank=False, null=False, db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
    class Meta(P4lModel.Meta):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
        abstract = True
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
class Author(P4lPerson):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   111
    record = models.ForeignKey('p4l.Record', related_name="authors", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
    
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
class SubjectPerson(P4lPerson):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   114
    record = models.ForeignKey('p4l.Record', related_name="subjectPersons", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   116
class Periodical(P4lModelLang):
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   117
    record = models.ForeignKey('p4l.Record', related_name="periodicals", db_index=True)
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   118
    label = models.CharField(max_length=2048, blank=False, null=False, db_index=True) #iiep:periodical
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
class BaseMeeting(P4lModel):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
    label = models.CharField(max_length=2048, blank=False, null=False, db_index=True) #rdfs:label
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
    meetingNumber = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:meetingNumber
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
    meetingPlace = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:meetingPlace
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
    meetingDate = models.CharField(max_length=2048, blank=True, null=True, db_index=True) #iiep:meetingDate
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   126
    meetingYear = models.PositiveSmallIntegerField(blank=True, null=True, db_index=True) #iiep:meetingYear
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
    class Meta(P4lModel.Meta):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
        abstract = True
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
class Meeting(BaseMeeting):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   132
    lang = models.CharField(max_length=15, blank=True, null=True, db_index=True) #@xml:lang
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   133
    record = models.ForeignKey('p4l.Record', related_name="meetings")
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
class SubjectMeeting(BaseMeeting):
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   137
    record = models.ForeignKey('p4l.Record', related_name="subjectMeetings", db_index=True)
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   140
class Record(P4lModel):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
    uri = models.URLField(max_length=2048, unique=True, db_index=True) #subject
17
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   142
    subjects = models.ManyToManyField('p4l.Subject') #dct:subject                                                       # <Thesaurus> with no country
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   143
    themes = models.ManyToManyField('p4l.Theme') #iiep:theme                                                            # <Themes>
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   144
    countries = models.ManyToManyField('p4l.Country') #iiep:country                                                     # <Thesaurus> filtered with country only
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
    identifier = models.CharField(max_length=128, unique=True, db_index=True) #dct:identifier    
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
    notes = models.TextField(blank=True, null=True) #iiep:notes    
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
    #issns foreign key from Isbn #iiep:issn
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
    #isbns foreign key from Isbn #iiep:isbn
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
    #documentCodes foreign key from Isbn #iiep:documentCode
17
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   150
    language = models.ForeignKey('p4l.Language', blank=True, null=True) #dct:language                                    # <Languages>
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   151
    otherLanguages = models.ManyToManyField('p4l.Language', related_name='otherLanguage_record') #iiep:otherLanguage     # <Languages>
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
    #titles foreign Key from Title #dct:title
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   153
    #abstracts foreign Key from Abstract #dct:abstract
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   154
    #addedTitles foreign Key from AddedTitle #iiep:addedTitle
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   155
    #titlesMainDocument foreign Key from TitleMainDocument #iiep:titleMainDocument
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
    editionStatement = models.CharField(max_length=1024, blank=True, null=True) #iiep:editionStatement
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   157
    #imprints foreign Key from Imprint #iiep:imprint
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   158
    #collations = foreign Key from Collation #iiep:collation
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   159
    #volumeIssues = foreign Key from VolumeIssue #iiep:volumeIssue
17
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   160
    projectNames = models.ManyToManyField('p4l.ProjectName') #iiep:projectName                                            # <Projects>
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   161
    #periodicals = foreign key from 'p4l.Periodical' #iiep:periodical
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   162
    #meetings = foreign key from 'p4l.Meeting' #iiep:meeting
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   163
    #series = foreign key from 'p4l.Serie'  #iiep:serie
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   164
    #authors = foreign key from 'p4l.Author' #iiep:author
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   165
    #subjectPersons = foreign key from 'p4l.SubjectPerson' #iiep:subjectPerson
17
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   166
    subjectCorporateBodies = models.ManyToManyField('p4l.CorporateAuthor', related_name='recordsSubjectCorporateBody') #iiep:subjectCorporateBody # <Organizations>
13
6296aa12fd71 model simplification, correct import on language. We do not try to impose a language when none is found. add forgotten abstract field on import.
ymh <ymh.work@gmail.com>
parents: 10
diff changeset
   167
    #subjectMeetings = foreign key from 'p4l.SubjectMeeting' #iiep:subjectMeeting
17
b31a67614f76 fill labels with sparql request on the go
cavaliet
parents: 14
diff changeset
   168
    corporateAuthors = models.ManyToManyField('p4l.CorporateAuthor', related_name='recordsCorporateAuthor') #iiep:subjectCorporateBody # <Organizations>
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
    #urls foreign Key from Url #iiep:url
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
    recordType = models.URLField(max_length=2048) #dct:type
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
   171
    
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
    isDocumentPart = models.BooleanField() #iiep:isDocumentPart
14
52fa6990e0bb adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents: 13
diff changeset
   173
    isMultilingual = models.BooleanField() #iiep:isMultilingual
0
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
    def __unicode__(self):
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
        return "Record id %s { identifier: %s, uri: %s, editionStatement: %s,  recordType: %s, isDocumentPart: %s, notes: %s, language : %s}" \
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   177
            % (
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
                self.id,
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
                self.identifier,
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
                self.uri,
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
                self.editionStatement,
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
                self.recordType,
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
                self.isDocumentPart,
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
                self.notes[:100] if self.notes else None,
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
                self.language.id if self.language else None
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
            )
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}issn', 3)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}documentCode', 3)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}country', 44)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}imprint', 5)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
#('{http://purl.org/dc/terms/}title', 4)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}isDocumentPart', 1)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   194
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}notes', 1)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}isbn', 8)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
#('{http://purl.org/dc/terms/}identifier', 1)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}meeting', 4)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}projectName', 10)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}addedTitle', 18)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
#('{http://purl.org/dc/terms/}subject', 29)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
#('{http://purl.org/dc/terms/}language', 1)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}serie', 4)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   203
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}volumeIssue', 3)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}url', 20)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   205
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}titleMainDocument', 3)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}otherLanguage', 13)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}periodical', 3)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   208
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}editionStatement', 1)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}collation', 4)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}subjectMeeting', 6)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}corporateAuthor', 7)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}author', 26)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   213
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}subjectPerson', 2)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}subjectCorporateBody', 8)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
#('{http://www.iiep.unesco.org/plan4learning/model.owl#}theme', 6)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
#('{http://purl.org/dc/terms/}abstract', 3)
81e7900b06a7 First import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
#('{http://purl.org/dc/terms/}type', 1)