def METHOD_NAME(self, record, pid=None):
    """Add a record and all of its versions to a community."""
    if not pid:
        pid = PersistentIdentifier.get('recid', record['recid'])
    pv = PIDVersioning(child=pid)
    for child in pv.children.all():
        rec = ZenodoRecord.get_record(
            child.get_assigned_object())
        if not self.community.has_record(rec):
            self.community.METHOD_NAME(rec)
            rec.commit()