예제 #1
0
class SplitterRegulations(object):
    """Implementation of Django+Elastic Search as regulations backend"""
    def __init__(self):
        self.dm = DMRegulations()
        self.es = ESRegulations()

        self.get = self.dm.get
        self.listing = self.dm.listing

    def bulk_put(self, regs, version, root_label):
        """Write to both"""
        self.dm.bulk_put(regs, version, root_label)
        self.es.bulk_put(regs, version, root_label)
예제 #2
0
    def __init__(self):
        self.dm = DMRegulations()
        self.es = ESRegulations()

        self.get = self.dm.get
        self.listing = self.dm.listing