maestro-server/report-app

View on GitHub
app/repository/model.py

Summary

Maintainability
A
0 mins
Test Coverage
F
50%
from app import db
from bson.objectid import ObjectId


class Model(object):
    def deleteCollection(self, table_name):
        print("====================== ", table_name)
        if table_name:
            return db.drop_collection(table_name)

    @staticmethod
    def makeObjectId(id):
        if id:
            return {'_id': Model.castObjectId(id)}

    @staticmethod
    def castObjectId(id):
        return ObjectId(id)