MCPcopy Create free account
hub / github.com/alephdata/aleph / _serialize

Method _serialize

aleph/views/serializers.py:147–151  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

145
146class AlertSerializer(Serializer):
147 def _serialize(self, obj):
148 obj["links"] = {"self": url_for("alerts_api.view", alert_id=obj.get("id"))}
149 role_id = obj.pop("role_id", None)
150 obj["writeable"] = request.authz.can_write_role(role_id)
151 return obj
152
153
154class CollectionSerializer(Serializer):

Callers

nothing calls this directly

Calls 3

url_forFunction · 0.90
can_write_roleMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected