Skip to content

Commit

Permalink
models: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Panero committed Feb 1, 2022
1 parent f1d0d9f commit bd51efd
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions invenio_oaiserver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,42 +72,5 @@ def validate_spec(self, key, value):
raise OAISetSpecUpdateError("Updating spec is not allowed.")
return value

# TODO: Add and remove can be implemented but it will require to
# update the `search_pattern`

# def add_record(self, record):
# """Add a record to the OAISet.

# :param record: Record to be added.
# :type record: `invenio_records.api.Record` or derivative.
# """
# record.setdefault('_oai', {}).setdefault('sets', [])

# assert not self.has_record(record)

# record['_oai']['sets'].append(self.spec)

# def remove_record(self, record):
# """Remove a record from the OAISet.

# :param record: Record to be removed.
# :type record: `invenio_records.api.Record` or derivative.
# """
# assert self.has_record(record)

# record['_oai']['sets'] = [
# s for s in record['_oai']['sets'] if s != self.spec]

# TODO: has_record can be implemented but it will require to
# to do a full search.

# def has_record(self, record):
# """Check if the record blongs to the OAISet.

# :param record: Record to be checked.
# :type record: `invenio_records.api.Record` or derivative.
# """
# return self.spec in record.get('_oai', {}).get('sets', [])


__all__ = ('OAISet', )

0 comments on commit bd51efd

Please sign in to comment.