forked from brmlab/brmbar-github
Shop.py: logging to sell
This commit is contained in:
parent
3ab537f7d9
commit
93f9b336b6
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
import brmbar
|
import brmbar
|
||||||
from .Currency import Currency
|
from .Currency import Currency
|
||||||
from .Account import Account
|
from .Account import Account
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class Shop:
|
class Shop:
|
||||||
""" BrmBar Shop
|
""" BrmBar Shop
|
||||||
|
@ -26,6 +28,8 @@ class Shop:
|
||||||
|
|
||||||
def sell(self, item, user, amount = 1):
|
def sell(self, item, user, amount = 1):
|
||||||
# Call the stored procedure for the sale
|
# Call the stored procedure for the sale
|
||||||
|
logger.debug("sell: item.id=%s amount=%s user.id=%s self.currency.id=%s",
|
||||||
|
item.id, amount, user.id, self.currency.id)
|
||||||
cost = self.db.execute_and_fetch(
|
cost = self.db.execute_and_fetch(
|
||||||
"SELECT public.sell_item(%s, %s, %s, %s, %s)",
|
"SELECT public.sell_item(%s, %s, %s, %s, %s)",
|
||||||
[item.id, amount, user.id, self.currency.id,
|
[item.id, amount, user.id, self.currency.id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue