From 109762f8e699ecfa0e31ef0c69b659b719b0a18a Mon Sep 17 00:00:00 2001 From: inebeate Date: Sun, 6 Mar 2011 12:27:46 +0000 Subject: [PATCH] mindre endringer --- conf.py | 2 +- data | Bin 9216 -> 9216 bytes text_based.py | 16 ++++++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/conf.py b/conf.py index ee342ff..e6052bd 100644 --- a/conf.py +++ b/conf.py @@ -1,4 +1,4 @@ -db_url = 'sqlite:///data' +db_url = 'postgres.pvv.ntnu.no://torjehoa_dibblerdummy:1234@postgres/torjehoa_dibblerdummy' quit_allowed = True stop_allowed = False show_tracebacks = True diff --git a/data b/data index 1f40586bde7139d23923db879c2def7ee29e5779..93d95be960a1f90e28ce339f34a3f3a9bf16e665 100644 GIT binary patch delta 17 YcmZqhXz-XI%_zB1<}o{?@FETw05SCh=Kufz delta 17 YcmZqhXz-XI%_y=_<}o`X>mm*r05OXM)Bpeg diff --git a/text_based.py b/text_based.py index a984c1b..5d0e6f6 100755 --- a/text_based.py +++ b/text_based.py @@ -884,24 +884,28 @@ class AdjustStockMenu(Menu): def _execute(self): self.print_header() product = self.input_product('Product> ') - + + print 'The stock of this product is: %d ' % (product.stock) - #print 'Write the number of products you have added to the stock' + print 'Write the number of products you have added to the stock' add_stock = self.input_int('Added stock> ', (-1000, 1000)) print 'You added %d to the stock of %s' % (add_stock,product) - + product.stock += add_stock - print 'The stock is now %d' % (product.stock) - + + print 'The stock is now %d' % (product.stock) + try: self.session.commit() print 'Stock is now stored' + self.pause() except sqlalchemy.exc.SQLAlchemyError, e: print 'Could not store stock: %s' % (e) self.pause() return - + print 'The stock is now %d' % (product.stock) + class AdjustCreditMenu(Menu): # reimplements ChargeMenu; these should be combined to one def __init__(self):