diff --git a/eos/db/__init__.py b/eos/db/__init__.py index 70f2d6e4a..09a092c81 100755 --- a/eos/db/__init__.py +++ b/eos/db/__init__.py @@ -66,7 +66,7 @@ from eos.db.saveddata.queries import getUser, getCharacter, getFit, getFitsWithS getCharacterList, getPrice, getDamagePatternList, getDamagePattern, \ getFitList, getFleetList, getFleet, save, remove, commit, add, \ getCharactersForUser, getMiscData, getSquadsIDsWithFitID, getWing, \ - getSquad, getFitsWithBooster + getSquad, getBoosterFits #If using in memory saveddata, you'll want to reflect it so the data structure is good. if config.saveddata_connectionstring == "sqlite:///:memory:": diff --git a/eos/db/saveddata/queries.py b/eos/db/saveddata/queries.py index 98d5e9183..01c2888ce 100755 --- a/eos/db/saveddata/queries.py +++ b/eos/db/saveddata/queries.py @@ -248,7 +248,7 @@ def getFitsWithShip(shipID, ownerID=None, where=None, eager=None): raise TypeError("ShipID must be integer") return fits -def getFitsWithBooster(ownerID=None, where=None, eager=None): +def getBoosterFits(ownerID=None, where=None, eager=None): """ Get all the fits that are flagged as a boosting ship If no user is passed, do this for all users. diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index b2bc6aa54..cdbb9efaf 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -845,8 +845,8 @@ class ShipBrowser(wx.Panel): for ship in ships: self.lpane.AddWidget(ShipItem(self.lpane, ship.ID, (ship.name, len(sFit.getFitsWithShip(ship.ID))), ship.race)) - for ID, name, shipID, shipName,timestamp in fitList: - self.lpane.AddWidget(FitItem(self.lpane, ID, (shipName, name,timestamp), shipID)) + for ID, name, shipID, shipName, booster, timestamp in fitList: + self.lpane.AddWidget(FitItem(self.lpane, ID, (shipName, name, booster, timestamp), shipID)) if len(ships) == 0 and len(fitList) == 0 : self.lpane.AddWidget(PFStaticText(self.lpane, label = "No matching results.")) self.lpane.RefreshList(doFocus = False) diff --git a/service/fit.py b/service/fit.py index 9b316f42d..037db3dae 100644 --- a/service/fit.py +++ b/service/fit.py @@ -104,6 +104,15 @@ class Fit(object): return names + def getBoosterFits(self): + ''' Lists fits flagged as booster ''' + fits = eos.db.getBoosterFits() + names = [] + for fit in fits: + names.append((fit.ID, fit.name)) + + return names + def countFitsWithShip(self, id): count = eos.db.countFitsWithShip(id) return count @@ -211,7 +220,7 @@ class Fit(object): results = eos.db.searchFits(name) fits = [] for fit in results: - fits.append((fit.ID, fit.name, fit.ship.item.ID, fit.ship.item.name, fit.timestamp)) + fits.append((fit.ID, fit.name, fit.ship.item.ID, fit.ship.item.name, fit.booster, fit.timestamp)) return fits def addImplant(self, fitID, itemID):