Move metadata widget code to metadata/widgets.py.
This commit is contained in:
14
mayan/apps/metadata/widgets.py
Normal file
14
mayan/apps/metadata/widgets.py
Normal 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()
|
||||
]
|
||||
)
|
||||
Reference in New Issue
Block a user