def METHOD_NAME(self, request, project_id, template_id, context):
    template = get_template_by_project_and_id(project_id, template_id)
    self.can_view_template(request, template)
    qsets = VersionInstance.objects.filter(template_id=template_id)
    namespace_id = request.query_params.get("namespace_id")
    if namespace_id:
        qsets = qsets.filter(ns_id=namespace_id)
    if context.get("latest"):
        serializer = serializers.TemplateReleaseSLZ(qsets.latest("created"))
    else:
        serializer = serializers.TemplateReleaseSLZ(qsets, many=True)
    return serializer.data