X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_common%2Fdbbase.py;h=d199ddebe00918f830c4c33e0a61b9419e676998;hb=refs%2Ftags%2Fv5.0.2;hp=b418079e6677dd1f9f6dc95c7c217c76ba8a92c1;hpb=c837a7819c5388b276ada7f29a085cd251119e4b;p=osm%2Fcommon.git diff --git a/osm_common/dbbase.py b/osm_common/dbbase.py index b418079..d199dde 100644 --- a/osm_common/dbbase.py +++ b/osm_common/dbbase.py @@ -130,7 +130,7 @@ class DbBase(object): """ raise DbException("Method 'create' not implemented") - def set_one(self, table, q_filter, update_dict, fail_on_empty=True): + def set_one(self, table, q_filter, update_dict, fail_on_empty=True, unset=None, pull=None, push=None): """ Modifies an entry at database :param table: collection or table @@ -138,6 +138,12 @@ class DbBase(object): :param update_dict: Plain dictionary with the content to be updated. It is a dot separated keys and a value :param fail_on_empty: If nothing matches filter it returns None unless this flag is set tu True, in which case it raises a DbException + :param unset: Plain dictionary with the content to be removed if exist. It is a dot separated keys, value is + ignored. If not exist, it is ignored + :param pull: Plain dictionary with the content to be removed from an array. It is a dot separated keys and value + if exist in the array is removed. If not exist, it is ignored + :param push: Plain dictionary with the content to be appended to an array. It is a dot separated keys and value + is appended to the end of the array :return: Dict with the number of entries modified. None if no matching is found. """ raise DbException("Method 'set_one' not implemented")