Add price_by_measure member to Item object

This commit is contained in:
KorenLazar
2021-08-16 12:39:28 +03:00
parent 27b45a4999
commit 98dcc1c33d
3 changed files with 18 additions and 20 deletions

View File

@@ -120,9 +120,6 @@ class SupermarketChain(object, metaclass=Meta):
"""
This function returns a string containing important information about a given supermarket's product.
"""
return Item(
name=item.find(re.compile(r'ItemN[a]?m[e]?')).text,
price=float(item.find('ItemPrice').text),
manufacturer=item.find(re.compile(r'Manufacture[r]?Name')).text,
code=item.find('ItemCode').text
)
return Item(name=item.find(re.compile(r'ItemN[a]?m[e]?')).text, price=float(item.find('ItemPrice').text),
price_by_measure=float(item.find('UnitOfMeasurePrice').text), code=item.find('ItemCode').text,
manufacturer=item.find(re.compile(r'Manufacture[r]?Name')).text)