Added weight to board game class
This commit is contained in:
parent
aaf0319151
commit
f96494cf07
2 changed files with 3 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ class BoardgameType(Enum):
|
|||
class BoardGameBase(SQLModel):
|
||||
name: str
|
||||
description: str
|
||||
weight: float
|
||||
image_url : str
|
||||
thumbnail_url : str
|
||||
year_published: int
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ def convert_xml_to_boardgame(boardgame_xml: ET.Element) -> boardgame_classes.Boa
|
|||
boardgame_dict = {
|
||||
"id" : int(boardgame_xml.get('id')),
|
||||
"name" : boardgame_xml.find('name').get('value'),
|
||||
"weight": boardgame_xml.find('statistics').find('ratings').find('averageweight').get('value'),
|
||||
"description" : boardgame_xml.find('description').text,
|
||||
"image_url" : boardgame_xml.find('image').text,
|
||||
"thumbnail_url" : boardgame_xml.find('thumbnail').text,
|
||||
|
|
@ -124,6 +125,7 @@ def convert_collection_xml_to_owned_boardgame(boardgame_extra_info: boardgame_cl
|
|||
boardgame_dict = {
|
||||
"id" : boardgame_extra_info.id,
|
||||
"name" : boardgame_extra_info.name,
|
||||
"weight" : boardgame_extra_info.weight,
|
||||
"description" : boardgame_extra_info.description,
|
||||
"image_url" : boardgame_extra_info.image_url,
|
||||
"thumbnail_url" : boardgame_extra_info.thumbnail_url,
|
||||
|
|
|
|||
Loading…
Reference in a new issue