9. Vidispine tags and filters¶
To make using vidispine easier in a theme a set of template tags have been created to help with common operations. To use you most load the vidispine tags into the current template:
{% load vidispinetags %}
Returns css classes from a mimetype.
For example, if value is application/x-adobe-indesign this function will return:
mimetype-application mimetype-application-x-adobe-indesign
Returns the best matching format of the item
Gets the value of a particular metadata field from an VS item object.
Returns a collection name for a given collection id
Usage: {{ collection_id_variable|getCollectionName }}
Returns a string representation of the item type
Get a human readable label for a job status
Get a human readable and translatable label for a job status
Gets a metadata field by label against a metadata field group
Gets the value of a particular metadata field from an VS item object.
Gets the extradata value of a particular metadata field given a extradata key.
Get the boolean value of hide if not set for a metadata field given a specific group arg is the group name
Gets the label of a particular metadata field from an VS item object.
Gets the value of a particular metadata field from an VS item object.
Gets the value of a particular metadata field from an VS item object.
For a list of previews and a list of MimeTypes in order return the object
For a list of previews and a list of MimeTypes in order return the objects that matches the mimetype
Gets the representative metadata field names and values for an item and limits it to number given as value.
Gets the representative metadata fields for an item and limits it to number given as value.
Get the storage name from a list of storages using an id If not name is found the ID is returned
Gets the system field value formatted.
For a list of previews, and a given MimeType return the URI to the preview file or return None. If none of the shapes contains the requested MimeType, then we look at the file extension.
Returns a human readable name for the user roles
For a list of previews, and a given MimeType return the URI to the preview file or return None. Then look at the URI, if there is no SERVER_NAME or SERVER_PORT, we get that from the request context. This solves bug *#1903 where preview URI’s can be relative but the flash player needs an absolute URL. ReplaceURL in the portal.conf can remove the SERVER_NAME and SERVER_PORT.
test: portal.utils.tests.template_tags_test.TestVidispineTags.test_preview_by_mime_type manage.py test utils.TestVidispineTags.test_preview_by_mime_type