MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / update_fit_modified

Function update_fit_modified

eos/events.py:23–39  ·  view source on GitHub ↗
(target, value, oldvalue, initiator)

Source from the content-addressed store, hash-verified

21
22
23def update_fit_modified(target, value, oldvalue, initiator):
24 if not target.owner:
25 return
26
27 if value != oldvalue:
28 # some things (like Implants) have a backref to the fit, which actually produces a list.
29 # In this situation, simply take the 0 index to get to the fit.
30 # There may be cases in the future in which there are multiple fits, so this should be
31 # looked at more indepth later
32 if isinstance(target.owner, InstrumentedList):
33 parent = target.owner[0]
34 else:
35 parent = target.owner
36
37 # ensure this is a fit we're dealing with
38 if isinstance(parent, Fit):
39 parent.modified = datetime.datetime.now()
40
41
42def apply_col_listeners(target, context):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected