Skip to content

Commit

Permalink
feat: created field productivity for Recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasbpro committed May 8, 2021
1 parent e986025 commit a6881cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion models/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ class RecipeModel(db.Model):
description = db.Column(db.String(constants['LONG_LENGTH']))
labor_cost = db.Column(db.Float(constants['PRICE_PRECISION']))
supply_cost = db.Column(db.Float(constants['PRICE_PRECISION']))
productivity = db.Column(db.Integer)
creation_date = db.Column(db.String(constants['MEDIUM_LENGTH']))
last_update = db.Column(db.String(constants['MEDIUM_LENGTH']))

def __init__(self, description, labor_cost, supply_cost):
def __init__(self, description, labor_cost, supply_cost, productivity):
self.description = description
self.labor_cost = labor_cost
self.supply_cost = supply_cost
self.creation_date = datetime.now().strftime("%d/%m/%Y %H:%M")
self.last_update = self.creation_date
self.productivity = productivity

def json(self):
materialList = {}
Expand All @@ -38,6 +40,7 @@ def json(self):
'last_update' : self.last_update,
'labor_cost' : self.labor_cost,
'supply_cost' : self.supply_cost,
'productivity' : self.productivity,
'materials' : materialList
}

Expand Down

0 comments on commit a6881cb

Please sign in to comment.