From bd51efdbe19f38c3521c4091bb4b4bd3a7eacd03 Mon Sep 17 00:00:00 2001 From: Pablo Panero Date: Tue, 1 Feb 2022 13:56:31 +0100 Subject: [PATCH] models: remove unused code --- invenio_oaiserver/models.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/invenio_oaiserver/models.py b/invenio_oaiserver/models.py index 7361d9b..d212d8d 100644 --- a/invenio_oaiserver/models.py +++ b/invenio_oaiserver/models.py @@ -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', )