Skip to content

Commit

Permalink
Load fleet data of projected fits
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed May 11, 2014
1 parent a0c1686 commit b783f06
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions service/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ def switchFit(self, fitID):
eos.db.commit()
self.recalc(fit, withBoosters=True)

def getFit(self, fitID):
def getFit(self, fitID, projected = False):
''' Gets fit from database, and populates fleet data.
Projected is a recursion flag that is set to reduce recursions into projected fits
'''
if fitID is None:
return None
fit = eos.db.getFit(fitID)
Expand All @@ -227,8 +231,13 @@ def getFit(self, fitID):
fit.fleet = None
else:
fit.fleet = f
self.recalc(fit, withBoosters=True)
fit.fill()

if not projected:
for fitP in fit.projectedFits:
self.getFit(fitP.ID, projected = True)
self.recalc(fit, withBoosters=True)
fit.fill()

eos.db.commit()
fit.inited = True
return fit
Expand Down

0 comments on commit b783f06

Please sign in to comment.