MCPcopy
hub / github.com/getsentry/sentry / serialize_model

Function serialize_model

src/sentry/notifications/utils/tasks.py:51–59  ·  view source on GitHub ↗
(arg: Model, key: str | None = None)

Source from the content-addressed store, hash-verified

49
50
51def serialize_model(arg: Model, key: str | None = None) -> dict[str, Any]:
52 meta = type(arg)._meta
53 return {
54 "type": MODEL_KEY,
55 "app_label": meta.app_label,
56 "model_name": meta.model_name,
57 "pk": arg.pk,
58 "key": key,
59 }
60
61
62def serialize_anonymous_user(arg: AnonymousUser, key: str | None = None) -> dict[str, Any]:

Callers 1

async_send_notificationFunction · 0.85

Calls 1

typeFunction · 0.85

Tested by

no test coverage detected