169 #Record import date and modification date |
169 #Record import date and modification date |
170 creation_date = models.DateTimeField( auto_now_add=True, serialize=False) |
170 creation_date = models.DateTimeField( auto_now_add=True, serialize=False) |
171 modification_date = models.DateTimeField(auto_now=True, serialize=False) |
171 modification_date = models.DateTimeField(auto_now=True, serialize=False) |
172 modified_by = models.ForeignKey(User, blank=True, null=True) |
172 modified_by = models.ForeignKey(User, blank=True, null=True) |
173 |
173 |
|
174 def get_titles(self): |
|
175 return [t.title for t in self.titles.all()] |
|
176 |
|
177 def get_authors(self): |
|
178 return [a.name for a in self.authors.all()] |
|
179 |
174 def get_imprints_years(self): |
180 def get_imprints_years(self): |
175 return sorted(set([i.imprintDate for i in self.imprints.all() if i.imprintDate])) |
181 return sorted(set([i.imprintDate for i in self.imprints.all() if i.imprintDate])) |
176 |
182 |
177 def __unicode__(self): |
183 def __unicode__(self): |
178 return "Record id %s { identifier: %s, uri: %s, editionStatement: %s, recordType: %s, isDocumentPart: %s, notes: %s, language : %s}" \ |
184 return "Record id %s { identifier: %s, uri: %s, editionStatement: %s, recordType: %s, isDocumentPart: %s, notes: %s, language : %s}" \ |