MCPcopy Create free account
hub / github.com/StackStorm/st2 / from_model

Method from_model

st2common/st2common/models/api/auth.py:70–75  ·  view source on GitHub ↗
(cls, model, mask_secrets=False)

Source from the content-addressed store, hash-verified

68
69 @classmethod
70 def from_model(cls, model, mask_secrets=False):
71 doc = super(cls, cls)._from_model(model, mask_secrets=mask_secrets)
72 doc["expiry"] = (
73 isotime.format(model.expiry, offset=False) if model.expiry else None
74 )
75 return cls(**doc)
76
77 @classmethod
78 def to_model(cls, instance):

Callers

nothing calls this directly

Calls 2

_from_modelMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected