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

Method from_model

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

Source from the content-addressed store, hash-verified

111
112 @classmethod
113 def from_model(cls, model, mask_secrets=False):
114 doc = super(cls, cls)._from_model(model, mask_secrets=mask_secrets)
115 doc["created_at"] = (
116 isotime.format(model.created_at, offset=False) if model.created_at else None
117 )
118 return cls(**doc)
119
120 @classmethod
121 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