inveniosoftware / invenio-oaiserver

Invenio module that adds more fun to the platform.
https://invenio-oaiserver.readthedocs.io
MIT License
3 stars 44 forks source link

OAISets: implement has_record #212

Open ppanero opened 2 years ago

ppanero commented 2 years ago

With the new dynamic sets the old has_records does not work. It can be implemented but would require 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', [])