def METHOD_NAME(self, validated_data):
    """DRF requires explicitly handling writeable nested serializers,
    here we pop the groups data and save it using its serializer.
    """
    groups = validated_data.pop('groups', [])
    dp = DataProduct.objects.METHOD_NAME(**validated_data)
    # Save groups for this target
    group_serializer = GroupSerializer(data=groups, many=True)
    if group_serializer.is_valid() and settings.TARGET_PERMISSIONS_ONLY is False:
        for group in groups:
            group_instance = Group.objects.get(pk=group['id'])
            assign_perm('tom_dataproducts.view_dataproduct', group_instance, dp)
            assign_perm('tom_dataproducts.change_dataproduct', group_instance, dp)
            assign_perm('tom_dataproducts.delete_dataproduct', group_instance, dp)
    return dp