diff --git a/corepos/api.py b/corepos/api.py index c444eae..e67a0ff 100644 --- a/corepos/api.py +++ b/corepos/api.py @@ -156,6 +156,12 @@ class CoreWebAPI(object): Update an existing Vendor record in CORE. :returns: Boolean indicating success of the operation. + + .. note:: + Currently this is being used to create a *new* vendor also. CORE's + ``vendors`` table does not use auto-increment for its PK, which + means we must provide one even when creating; therefore this method + may be used for that. """ columns['vendorID'] = vendorID params = { @@ -165,10 +171,4 @@ class CoreWebAPI(object): } response = self.post(params) result = self.parse_response(response) - - if result == 'OK': - return True - - # TODO: need to see what happens here, when it happens - raise NotImplementedError("Unexpected result for set_vendor: {}".format(result)) - # return False + return json.loads(result) diff --git a/corepos/db/util.py b/corepos/db/util.py index 582aa17..324a057 100644 --- a/corepos/db/util.py +++ b/corepos/db/util.py @@ -2,7 +2,7 @@ ################################################################################ # # pyCOREPOS -- Python Interface to CORE POS -# Copyright © 2018-2019 Lance Edgar +# Copyright © 2018-2020 Lance Edgar # # This file is part of pyCOREPOS. # @@ -24,11 +24,9 @@ CORE POS Database Utilities """ -from __future__ import unicode_literals, absolute_import - import sqlalchemy as sa -from corepos.db import model as corepos +from corepos.db.office_op import model as corepos def get_last_card_number(session):