diff --git a/eos/db/saveddata/price.py b/eos/db/saveddata/price.py index 2135d20cf..8be7f6519 100644 --- a/eos/db/saveddata/price.py +++ b/eos/db/saveddata/price.py @@ -25,8 +25,10 @@ from eos.saveddata.price import Price prices_table = Table("prices", saveddata_meta, Column("typeID", Integer, primary_key=True), - Column("price", Float), + Column("price", Float, default=0.0), Column("time", Integer, nullable=False), Column("failed", Integer)) -mapper(Price, prices_table) +mapper(Price, prices_table, properties={ + "_Price__price": prices_table.c.price, +}) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 2b1d2665c..40c875a18 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -457,7 +457,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): # Check max group fitted max = self.getModifiedItemAttr("maxGroupFitted") if max is not None: - current = 0 if self.owner != fit else -1 + current = 0 # if self.owner != fit else -1 # Disabled, see #1278 for mod in fit.modules: if mod.item and mod.item.groupID == self.item.groupID: current += 1 diff --git a/eos/saveddata/price.py b/eos/saveddata/price.py index 304d6fedd..6618119d0 100644 --- a/eos/saveddata/price.py +++ b/eos/saveddata/price.py @@ -30,7 +30,7 @@ class Price(object): def __init__(self, typeID): self.typeID = typeID self.time = 0 - self.price = 0 + self.__price = 0 self.failed = None @reconstructor @@ -40,3 +40,11 @@ class Price(object): @property def isValid(self): return self.time >= time.time() + + @property + def price(self): + return self.__price or 0.0 + + @price.setter + def price(self, price): + self.__price = price