src/p4l/models/data.py
changeset 4 047675624f45
parent 0 81e7900b06a7
child 9 3bc55f57b2b1
equal deleted inserted replaced
3:63c5437a9b7d 4:047675624f45
   160     class Meta(P4lModel.Meta):
   160     class Meta(P4lModel.Meta):
   161         unique_together = ['label','acronym']
   161         unique_together = ['label','acronym']
   162 
   162 
   163 class Record(P4lModel):
   163 class Record(P4lModel):
   164     uri = models.URLField(max_length=2048, unique=True, db_index=True) #subject
   164     uri = models.URLField(max_length=2048, unique=True, db_index=True) #subject
   165     subjects = models.ManyToManyField('p4l.Subject') #dct:subject
   165     subjects = models.ManyToManyField('p4l.Subject') #dct:subject                                                       # Thesaurus with no country
   166     themes = models.ManyToManyField('p4l.Theme') #iiep:theme
   166     themes = models.ManyToManyField('p4l.Theme') #iiep:theme                                                            # Theme
   167     countries = models.ManyToManyField('p4l.Country') #iiep:country
   167     countries = models.ManyToManyField('p4l.Country') #iiep:country                                                     # Thesaurus filtered with country only
   168     identifier = models.CharField(max_length=128, unique=True, db_index=True) #dct:identifier    
   168     identifier = models.CharField(max_length=128, unique=True, db_index=True) #dct:identifier    
   169     notes = models.TextField(blank=True, null=True) #iiep:notes    
   169     notes = models.TextField(blank=True, null=True) #iiep:notes    
   170     #issns foreign key from Isbn #iiep:issn
   170     #issns foreign key from Isbn #iiep:issn
   171     #isbns foreign key from Isbn #iiep:isbn
   171     #isbns foreign key from Isbn #iiep:isbn
   172     #documentCodes foreign key from Isbn #iiep:documentCode
   172     #documentCodes foreign key from Isbn #iiep:documentCode
   173     language = models.ForeignKey('p4l.Language', blank=True, null=True) #dct:language
   173     language = models.ForeignKey('p4l.Language', blank=True, null=True) #dct:language                                    # Language
   174     otherLanguages = models.ManyToManyField('p4l.Language', related_name='otherLanguage_record') #iiep:otherLanguage
   174     otherLanguages = models.ManyToManyField('p4l.Language', related_name='otherLanguage_record') #iiep:otherLanguage     # Language
   175     #titles foreign Key from Title #dct:title
   175     #titles foreign Key from Title #dct:title
   176     #addedTitles foreign Key from AddedTitle #iiep:addedTitle
   176     #addedTitles foreign Key from AddedTitle #iiep:addedTitle
   177     #titlesMainDocument foreign Key from TitleMainDocument #iiep:titleMainDocument
   177     #titlesMainDocument foreign Key from TitleMainDocument #iiep:titleMainDocument
   178     editionStatement = models.CharField(max_length=1024, blank=True, null=True) #iiep:editionStatement
   178     editionStatement = models.CharField(max_length=1024, blank=True, null=True) #iiep:editionStatement
   179     #imprints foreign Key from Imprint #iiep:imprint
   179     #imprints foreign Key from Imprint #iiep:imprint
   183     periodicals = models.ManyToManyField('p4l.Periodical', through='p4l.RecordPeriodical') #iiep:periodical
   183     periodicals = models.ManyToManyField('p4l.Periodical', through='p4l.RecordPeriodical') #iiep:periodical
   184     meetings = models.ManyToManyField('p4l.Meeting', through='p4l.RecordMeeting') #iiep:meeting
   184     meetings = models.ManyToManyField('p4l.Meeting', through='p4l.RecordMeeting') #iiep:meeting
   185     series = models.ManyToManyField('p4l.Serie', through='p4l.RecordSerie')  #iiep:serie
   185     series = models.ManyToManyField('p4l.Serie', through='p4l.RecordSerie')  #iiep:serie
   186     authors = models.ManyToManyField('p4l.Author') #iiep:author
   186     authors = models.ManyToManyField('p4l.Author') #iiep:author
   187     subjectPersons = models.ManyToManyField('p4l.SubjectPerson') #iiep:subjectPerson
   187     subjectPersons = models.ManyToManyField('p4l.SubjectPerson') #iiep:subjectPerson
   188     subjectCorporateBodies = models.ManyToManyField('p4l.CorporateBody') #iiep:subjectCorporateBody
   188     subjectCorporateBodies = models.ManyToManyField('p4l.CorporateBody') #iiep:subjectCorporateBody                       # Organisation ?
   189     subjectMeetings = models.ManyToManyField('p4l.SubjectMeeting') #iiep:subjectMeeting
   189     subjectMeetings = models.ManyToManyField('p4l.SubjectMeeting') #iiep:subjectMeeting
   190     corporateAuthors = models.ManyToManyField('p4l.CorporateAuthor') #iiep:corporateAuthor
   190     corporateAuthors = models.ManyToManyField('p4l.CorporateAuthor') #iiep:corporateAuthor                                # Organisation ?
   191     #urls foreign Key from Url #iiep:url
   191     #urls foreign Key from Url #iiep:url
   192     recordType = models.URLField(max_length=2048) #dct:type
   192     recordType = models.URLField(max_length=2048) #dct:type
   193     isDocumentPart = models.BooleanField() #iiep:isDocumentPart
   193     isDocumentPart = models.BooleanField() #iiep:isDocumentPart
   194 
   194 
   195     def __unicode__(self):
   195     def __unicode__(self):