예제 #1
0
class TransactionDescriptionSerializer(serializers.ModelSerializer):
    narratives = NarrativeSerializer(many=True)

    class Meta:
        model = models.TransactionDescription
        fields = (
            'narratives',
        )
예제 #2
0
파일: serializers.py 프로젝트: HatimKH/OIPA
class ResultTitleSerializer(serializers.ModelSerializer):
    narratives = NarrativeSerializer(source="*")

    class Meta:
        model = iati_models.ResultTitle
        fields = (
            'narratives',
        )
예제 #3
0
파일: serializers.py 프로젝트: HatimKH/OIPA
class ResultDescriptionSerializer(serializers.ModelSerializer):
    narratives = NarrativeSerializer(source="*")

    class Meta:
        model = iati_models.ResultDescription
        fields = (
            'narratives',
        )
예제 #4
0
class TransactionProviderSerializer(serializers.ModelSerializer):
    ref = serializers.CharField()
    type = CodelistSerializer()
    narratives = NarrativeSerializer(many=True)
    provider_activity_id = serializers.CharField(
        source="provider_activity_ref", required=False)

    class Meta:
        model = models.TransactionProvider
        fields = ('ref', 'type', 'provider_activity_id', 'narratives')
예제 #5
0
파일: serializers.py 프로젝트: HatimKH/OIPA
class DescriptionSerializer(serializers.ModelSerializer):
    type = CodelistSerializer()
    narratives = NarrativeSerializer(many=True)

    class Meta:
        model = iati_models.Description
        fields = (
            'type',
            'narratives'
        )
예제 #6
0
class TransactionReceiverSerializer(serializers.ModelSerializer):
    ref = serializers.CharField()
    type = CodelistSerializer()
    narratives = NarrativeSerializer(many=True)
    receiver_activity_id = serializers.CharField(
        source="receiver_activity_ref")

    class Meta:
        model = models.TransactionReceiver
        fields = ('ref', 'type', 'receiver_activity', 'receiver_activity_id',
                  'narratives')
예제 #7
0
파일: serializers.py 프로젝트: punkch/OIPA
class TransactionReceiverSerializer(serializers.ModelSerializer):
    ref = serializers.CharField()
    type = CodelistSerializer()
    narratives = NarrativeSerializer(many=True)
    receiver_activity = serializers.HyperlinkedRelatedField(
        read_only=True, view_name='activities:activity-detail')
    receiver_activity_id = serializers.CharField(
        source="receiver_activity_ref")

    class Meta:
        model = models.TransactionReceiver
        fields = ('ref', 'type', 'receiver_activity', 'receiver_activity_id',
                  'narratives')
예제 #8
0
파일: serializers.py 프로젝트: HatimKH/OIPA
class ActivityPolicyMarkerSerializer(serializers.ModelSerializer):
    code = CodelistSerializer()
    vocabulary = VocabularySerializer()
    vocabulary_uri = serializers.URLField()
    significance = CodelistSerializer()
    narratives = NarrativeSerializer(many=True)

    class Meta:
        model = iati_models.ActivityPolicyMarker
        fields = (
            'narratives',
            'vocabulary',
            'vocabulary_uri',
            'significance',
            'code',
        )
예제 #9
0
파일: serializers.py 프로젝트: HatimKH/OIPA
class ParticipatingOrganisationSerializer(serializers.ModelSerializer):
    # TODO: Link to organisation standard (hyperlinked)
    ref = serializers.CharField(source='normalized_ref')
    type = CodelistSerializer()
    role = CodelistSerializer()
    activity_id = serializers.CharField(source='org_activity_id')
    narratives = NarrativeSerializer(many=True)

    class Meta:
        model = iati_models.ActivityParticipatingOrganisation
        fields = (
            'ref',
            'type',
            'role',
            'activity_id',
            'narratives',
        )
예제 #10
0
파일: serializers.py 프로젝트: HatimKH/OIPA
class ReportingOrganisationSerializer(DynamicFieldsModelSerializer):
    # TODO: Link to organisation standard (hyperlinked)
    ref = serializers.CharField(source="normalized_ref")
    type = CodelistSerializer()
    secondary_reporter = serializers.BooleanField()
    narratives = NarrativeSerializer(many=True)
    # organisation = OrganisationSerializer()
    organisation = serializers.HyperlinkedRelatedField(view_name='organisations:organisation-detail', read_only=True)

    class Meta:
        model = iati_models.ActivityReportingOrganisation
        fields = (
            'ref',
            'organisation',
            'type',
            'secondary_reporter',
            'narratives',
        )
예제 #11
0
class TransactionProviderSerializer(serializers.ModelSerializer):
    ref = serializers.CharField()
    type = CodelistSerializer()
    narrative = NarrativeSerializer(many=True, source='narratives')
    provider_activity = serializers.HyperlinkedRelatedField(
        read_only=True,
        view_name='activities:activity-detail')
    provider_activity_id = serializers.CharField(
        source="provider_activity_ref", required=False)

    class Meta:
        model = models.TransactionProvider
        fields = (
            'ref',
            'type',
            'provider_activity',
            'provider_activity_id',
            'narrative'
        )
예제 #12
0
파일: serializers.py 프로젝트: HatimKH/OIPA
class TitleSerializer(serializers.Serializer):
    narratives = NarrativeSerializer(many=True)

    class Meta:
        model = iati_models.Title
        fields = ('narratives',)