'Since UUID is not a unique field, but part of a composite unique key, this returns the latest version by UUID
This should always be used in place of Document2.objects.get(uuid=) when a single document is expected
:param user: User to check permissions against
:param uuid
:param perm_type: permission type to check against'

def get_by_uuid(self, user, uuid, perm_type='read'):

    docs = self.filter(uuid=uuid).order_by('-last_modified')
    if (not docs.exists()):
        raise FilesystemException((_('Document    with    UUID    %s    not    found.') % uuid))
    latest_doc = docs[0]
    if (perm_type == 'write'):
        latest_doc.can_write_or_exception(user)
    else:
        latest_doc.can_read_or_exception(user)
    return latest_doc
