Move metadata widget code to metadata/widgets.py.

This commit is contained in:
Roberto Rosario
2015-10-06 02:31:37 -04:00
parent 97d8529994
commit 6f4426dce0
3 changed files with 15 additions and 10 deletions

View File

@@ -0,0 +1,14 @@
from __future__ import unicode_literals
def get_metadata_string(document):
"""
Return a formated representation of a document's metadata values
"""
return ', '.join(
[
'%s - %s' % (
document_metadata.metadata_type, document_metadata.value
) for document_metadata in document.metadata.all()
]
)