Laget en meny for å legge til produkter.

This commit is contained in:
Øyvind Almelid 2010-05-08 20:30:32 +00:00
parent 09bf703a35
commit d35c3cabea
2 changed files with 3 additions and 3 deletions

BIN
data

Binary file not shown.

View File

@ -309,7 +309,7 @@ class ProductListMenu(Menu):
print line_format % (p.name, p.price, p.bar_code)
self.pause()
class AddProductMenu(Menu)
class AddProductMenu(Menu):
def __init__(self):
Menu.__init__(self, 'Add product')
@ -322,7 +322,7 @@ class AddProductMenu(Menu)
session.add(product)
session.commit()
session.close()
print 'Added product %s, price %d, bar code %d' (name,price,bar_code)
print 'Added product %s, price %d, bar code %d' % (name,price,bar_code)
self.pause()
@ -393,7 +393,7 @@ def retrieve_product(search_str, session):
#main = MainMenu()
main = Menu('Dibbler main menu',
items=[BuyMenu(), ChargeMenu(), TransferMenu(), Menu('Add user'), Menu('Add product'),
items=[BuyMenu(), ChargeMenu(), TransferMenu(), Menu('Add user'), AddProductMenu(),
ShowUserMenu(), ProductListMenu()],
exit_msg='happy happy joy joy')
main.execute()