Bug fix and more work

This commit is contained in:
blitzmann
2014-02-22 01:14:33 -05:00
parent f2c1002d58
commit b910982994
4 changed files with 14 additions and 5 deletions

View File

@@ -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:":

View File

@@ -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.

View File

@@ -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)

View File

@@ -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):