add material price setter

This commit is contained in:
Martin
2016-07-10 23:43:41 +02:00
parent 7e029d9637
commit e2831351b4
+5
View File
@@ -41,6 +41,11 @@ class Material(db.Model):
return float(self.material_price.price) return float(self.material_price.price)
return None return None
@price.setter
def price(self, value):
if self.material_price:
self.material_price.price = value
def to_json(self): def to_json(self):
return { return {
'id': self.id, 'id': self.id,