'Set the title of given name to given users.'

def set_auto_title(self, name, users):

    try:
        title = self.get(name=name)
        current = set(title.users.all())
        users = set(users)
        title.users.remove(*[u for u in (current - users)])
        title.users.add(*[u for u in (users - current)])
    except Title.DoesNotExist:
        title = Title(name=name, is_auto=True)
        title.save()
        title.users.add(*users)
