def get_collection_for_id()

in atomresponder/vs_mixin.py [0:0]


    def get_collection_for_id(self, projectid, expected_type="Project"):
        """
        Returns a VSCollection for the given project ID. Raises VSNotFound if the collection does not exist, or
        exceptions.NotAProject if it is not a project.
        :return:
        """
        collection = VSCollection(url=settings.VIDISPINE_URL,user=settings.VIDISPINE_USERNAME,passwd=settings.VIDISPINE_PASSWORD)
        collection.populate(projectid)
        if collection.get('gnm_type')!=expected_type:
            raise NotAProjectError("{0} is a {1}".format(projectid, collection.get('gnm_type')))
        return collection