From b783f0641c277bb537e25e526306aac176f15b1c Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sat, 10 May 2014 22:49:12 -0400 Subject: [PATCH] Load fleet data of projected fits --- service/fit.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/service/fit.py b/service/fit.py index bc7e7bf563..2bc071bbc7 100644 --- a/service/fit.py +++ b/service/fit.py @@ -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) @@ -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