Endret strekkodekolonnen til teksttype i databasen.
This commit is contained in:
parent
dcb249991b
commit
39e1d4ef08
2
db.py
2
db.py
|
@ -33,7 +33,7 @@ class User(Base):
|
|||
class Product(Base):
|
||||
__tablename__ = 'products'
|
||||
|
||||
bar_code = Column(Integer, primary_key=True)
|
||||
bar_code = Column(String(13), primary_key=True)
|
||||
name = Column(String(30))
|
||||
price = Column(Integer)
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ class AddProductMenu(Menu):
|
|||
def _execute(self):
|
||||
self.session = Session()
|
||||
self.print_header()
|
||||
bar_code = self.input_int('Bar code> ')
|
||||
bar_code = self.input_str('Bar code> ', Product.bar_code_re, (8,13))
|
||||
name = self.input_str('Name> ', Product.name_re, (1,30))
|
||||
price = self.input_int('Price> ', (1,100000))
|
||||
product = Product(bar_code, name, price)
|
||||
|
|
Loading…
Reference in New Issue