Skip to content

provenance_serializers#

AbstractFreeformConceptSerializer#

Bases: CommonNestedModelSerializer

Source code in src/apps/core/serializers/provenance_serializers.py
class AbstractFreeformConceptSerializer(CommonNestedModelSerializer):
    class Meta:
        fields = ("id", "concept_identifier", "pref_label", "definition", "in_scheme")
        list_serializer_class = CommonListSerializer

VariableConceptSerializer#

Bases: AbstractFreeformConceptSerializer

Source code in src/apps/core/serializers/provenance_serializers.py
class VariableConceptSerializer(AbstractFreeformConceptSerializer):
    class Meta(AbstractFreeformConceptSerializer.Meta):
        model = VariableConcept

VariableUniverseSerializer#

Bases: AbstractFreeformConceptSerializer

Source code in src/apps/core/serializers/provenance_serializers.py
class VariableUniverseSerializer(AbstractFreeformConceptSerializer):
    class Meta(AbstractFreeformConceptSerializer.Meta):
        model = VariableUniverse

ProvenanceVariableSerializer#

Bases: CommonNestedModelSerializer

Source code in src/apps/core/serializers/provenance_serializers.py
class ProvenanceVariableSerializer(CommonNestedModelSerializer):
    concept = VariableConceptSerializer(required=False, allow_null=True, lazy=True)
    universe = VariableUniverseSerializer(required=False, allow_null=True, lazy=True)

    class Meta:
        model = ProvenanceVariable
        fields = ("id", "pref_label", "description", "concept", "universe", "representation")
        list_serializer_class = CommonListSerializer

ProvenanceModelSerializer#

Bases: CommonNestedModelSerializer

Source code in src/apps/core/serializers/provenance_serializers.py
class ProvenanceModelSerializer(CommonNestedModelSerializer):
    spatial = SpatialModelSerializer(required=False, allow_null=True, lazy=True)
    temporal = TemporalModelSerializer(required=False, allow_null=True, lazy=True)
    lifecycle_event = LifecycleEvent.get_serializer_field(required=False, allow_null=True)
    preservation_event = PreservationEvent.get_serializer_field(required=False, allow_null=True)
    event_outcome = EventOutcome.get_serializer_field(required=False, allow_null=True)
    is_associated_with = DatasetActorProvenanceSerializer(many=True, required=False)
    used_entity = EntitySerializer(many=True, required=False, lazy=True)
    variables = ProvenanceVariableSerializer(many=True, required=False, lazy=True)

    class Meta:
        model = Provenance
        fields = (
            "id",
            "title",
            "description",
            "spatial",
            "temporal",
            "lifecycle_event",
            "preservation_event",
            "event_outcome",
            "outcome_description",
            "is_associated_with",
            "used_entity",
            "variables",
        )
        read_only_fields = ("id",)
        list_serializer_class = CommonListSerializer
        validators = [AnyOf([f for f in fields if f != "id"])]