Example #1
0
    def update(self, instance, validated_data):
        organisation = validated_data.get('organisation')
        title_narratives_data = validated_data.pop('title_narratives', [])

        update_instance = org_models.OrganisationDocumentLink(**validated_data)
        update_instance.id = instance.id
        update_instance.save()

        save_narratives(update_instance.documentlinktitle,
                        title_narratives_data, organisation)

        organisation.modified = True
        organisation.save()

        return update_instance
Example #2
0
 def get_queryset(self):
     pk = self.kwargs.get('document_link_id')
     return models.OrganisationDocumentLink(
         pk=pk).documentlinkrecipient_country_set.all()
Example #3
0
 def get_queryset(self):
     pk = self.kwargs.get('document_link_id')
     return models.OrganisationDocumentLink(
         pk=pk).documentlinklanguage_set.all()