X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_common%2Fdbbase.py;fp=osm_common%2Fdbbase.py;h=2dada76fdfaa35ed8b5d20c5379764ebca1b4978;hb=ebbf35359cebd00c42afc93f0d65ab61b38ad70a;hp=aa9c24eb3f0788a079c98672fb6ee0a664a16f2f;hpb=acbbdf2e24f53353f18b60fbb67b33f616bb3aae;p=osm%2Fcommon.git diff --git a/osm_common/dbbase.py b/osm_common/dbbase.py index aa9c24e..2dada76 100644 --- a/osm_common/dbbase.py +++ b/osm_common/dbbase.py @@ -6,6 +6,7 @@ __author__ = "Alfonso Tierno " class DbException(Exception): def __init__(self, message, http_code=HTTPStatus.NOT_FOUND): + # TODO change to http.HTTPStatus instead of int that allows .value and .name self.http_code = http_code Exception.__init__(self, "database exception " + message) @@ -22,16 +23,16 @@ class DbBase(object): pass def get_list(self, table, filter={}): - pass + raise DbException("Method 'get_list' not implemented") def get_one(self, table, filter={}, fail_on_empty=True, fail_on_more=True): - pass + raise DbException("Method 'get_one' not implemented") def create(self, table, indata): - pass + raise DbException("Method 'create' not implemented") def del_list(self, table, filter={}): - pass + raise DbException("Method 'del_list' not implemented") def del_one(self, table, filter={}, fail_on_empty=True): - pass + raise DbException("Method 'del_one' not implemented")