Fix fit copying and deleting fits not being reflected in other fits.

This commit is contained in:
blitzmann
2015-07-11 11:19:10 -04:00
parent 23b458534f
commit 86ee5292d8
2 changed files with 10 additions and 3 deletions

View File

@@ -210,11 +210,10 @@ class Fit(object):
@property
def projectedFits(self):
# only in extreme edge cases will the fit be invalid, but to be sure do
# not return them. By this time
# not return them.
return [fit for fit in self.__projectedFits.values() if not fit.isInvalid]
def getProjectionInfo(self, fitID):
print "get projection info for fitID: ", fitID
return self.projectedOnto.get(fitID, None)
@property
@@ -967,6 +966,9 @@ class Fit(object):
c.append(deepcopy(i, memo))
for fit in self.projectedFits:
copy.projectedFits.append(fit)
copy.__projectedFits[fit.ID] = fit
# this bit is required -- see GH issue # 83
eos.db.saveddata_session.flush()
eos.db.saveddata_session.refresh(fit)
return copy

View File

@@ -178,6 +178,11 @@ class Fit(object):
eos.db.remove(fit)
# refresh any fits this fit is projected onto. Otherwise, if we have
# already loaded those fits, they will not reflect the changes
for projection in fit.projectedOnto.values():
eos.db.saveddata_session.refresh(projection.victim_fit)
def copyFit(self, fitID):
fit = eos.db.getFit(fitID)
newFit = copy.deepcopy(fit)