Moved metadata representation string to model
This commit is contained in:
@@ -155,6 +155,9 @@ class Document(models.Model):
|
||||
|
||||
def exists(self):
|
||||
return self.file.storage.exists(self.file.path)
|
||||
|
||||
def get_metadata_string(self):
|
||||
return u', '.join([u'%s - %s' % (metadata.metadata_type, metadata.value) for metadata in self.documentmetadata_set.select_related('metadata_type', 'document').defer('document__document_type', 'document__file', 'document__description', 'document__file_filename', 'document__uuid', 'document__date_added', 'document__date_updated', 'document__file_mimetype', 'document__file_mime_encoding')])
|
||||
|
||||
def get_metadata_groups(self):
|
||||
errors = []
|
||||
|
||||
Reference in New Issue
Block a user