view backend/arangodb/ArangoDb.py @ 258:4ca1fac32dde

Pull the constant of days to keep feed entries into the abstract class
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 12 Mar 2019 02:39:18 +0100
parents f79be01821c4
children
line wrap: on
line source

# -*- coding: utf-8 -*-

class ArangoDb(object):
    def __init__(self, database):
        super(ArangoDb, self).__init__()
        self.database = database

    def get_or_create_collection(self, collection_name):
        if self.database.hasCollection(collection_name):
            return self.database[collection_name]
        else:
            return self.database.createCollection(name=collection_name)

    def AQLQuery(self, query, bind_vars={}):
        return self.database.AQLQuery(query, bindVars=bind_vars)