Skip to content

Commit

Permalink
implemented checkandinsert #36
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanse committed Oct 21, 2020
1 parent 1c1d277 commit 026e053
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bfabric/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.19"
__version__ = "0.10.20"
24 changes: 24 additions & 0 deletions bfabric/bfabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,30 @@ def save_object(self, endpoint, obj, debug=None):
return getattr(self.cl[endpoint].service.save(QUERY), endpoint, None)
except:
raise

def checkandinsert_object(self, endpoint, obj, debug=None):
"""
wsdl method to check iff dependencies are fullfield
"""

self.query_counter = self.query_counter + 1
QUERY = dict(login=self.bflogin, password=self.bfpassword)
QUERY[endpoint] = obj

try:
if not endpoint in self.cl:
self.cl[endpoint] = Client("".join((self.webbase, '/', endpoint, "?wsdl")), cache=None)
except:
raise


try:
if debug is not None:
return self.cl[endpoint].service.save(QUERY)

return getattr(self.cl[endpoint].service.checkandinsert(QUERY), endpoint, None)
except:
raise

def delete_object(self, endpoint, id=None, debug=None):
"""
Expand Down

0 comments on commit 026e053

Please sign in to comment.