from ocds.storage.helpers import CouchView


class AllDocs(CouchView):

    design = 'docs'

    @staticmethod
    def map(doc):
        yield (doc['tenderID'], doc)


class DateView(CouchView):

    design = 'dates'

    @staticmethod
    def map(doc):
        yield (doc['dateModified'], doc)


views = [
    AllDocs(),
    DateView()
]

from ocds.storage.helpers import CouchView


class AllDocs(CouchView):

    design = 'docs'

    @staticmethod
    def map(doc):
        if 'doc_type' in doc and doc['doc_type'] != 'Tender':
            return

        yield doc['_id'], doc


class DateView(CouchView):

    design = 'dates'

    @staticmethod
    def map(doc):
        if 'doc_type' in doc and doc['doc_type'] != 'Tender':
            return

        yield doc['_id'], doc['dateModified']


views = [
    AllDocs(),
    DateView()
]

Add filter in design docs
Add filter in design docs
