@classmethod
def is_duplicated(cls, id_collection, facet_name):
    """Check if the given facet is already assigned to this collection.

        .. note:: This works well as a pre-check, however saving can still fail
            if somebody else creates the same record in other session
            (phantom reads).
        """
    return bool(cls.query.filter(cls.id_collection == id_collection, cls.
        facet_name == facet_name).count())
