original_docstring: 
      Allow a vertex attribute to be added, or edited based on its containing
      graph and vertex.
      Body of POST should be of the form:
          {"graph_id": 3, "vx_id": 0, "label": "x", "value": 1.0}
      Where graph_id and vx_id identify the parent graph/vertex, label is the name
      of the attribute being modified and value is the value to change it to.
      
docstring: Allow a vertex attribute to be added, or edited based on its containing
  graph and vertex.
docstring_tokens: Allow a vertex attribute to be added or edited based on its containing graph and vertex .
code: def EditVertexAttribute(request):
      """
      Allow a vertex attribute to be added, or edited based on its containing
      graph and vertex.
      Body of POST should be of the form:
          {"graph_id": 3, "vx_id": 0, "label": "x", "value": 1.0}
      Where graph_id and vx_id identify the parent graph/vertex, label is the name
      of the attribute being modified and value is the value to change it to.
      """
      if request.method == 'POST':
  
          # Ensure post has graph_id, vx_id, label, value
          missing_keys = False
          missing_keys_error = "Missing keys: "
          for key in ['graph_id', 'vx_id', 'label', 'value']:
              if key not in request.data:
                  missing_keys_error = missing_keys_error + key + " "
                  missing_keys = True
  
          if missing_keys:
              return Response({"Error": missing_keys_error, "data": request.data})
  
          try:
              graph_fk = request.data['graph_id']
              vx_id = request.data['vx_id']
              label = request.data['label']
              value = request.data['value']
  
              # Get parent Vertex
              vertex = Vertex.objects.filter(graph_fk_id=graph_fk, vx_id=vx_id).last()
              if vertex is None:
                  return Response({"Info": "Could not find vertex with supplied graph_fk" +
                                           " and vx_id values", "data": request.data})
              print("## DEBUG Vertex=" + str(vertex))
              attribute = VertexAttrib.objects.filter(vertex_fk=vertex, attrib_fk__label=label).last()
              if attribute is None:
                  # See if a vertex attribute is defined for the graph with this label
                  graph = vertex.graph_fk
                  vertex_attribute = graph.graphvertexattrib_set.all().filter(label=label).last()
                  if vertex_attribute is None:
                      return Response({"Info": "Could not find attribute with supplied label for " +
                                               "selected vertex", "data": request.data})
                  else:
                      attribute = VertexAttrib(vertex_fk=vertex, attrib_fk=vertex_attribute)
  
              # Set value
              __update_vertex_attribute(attribute, value)
          except Exception as e:
              return Response({"Error": "An exception occured processing request", "data": request.data})
  
          return Response({"Info": "Found all keys", "data": request.data})
code_tokens: def EditVertexAttribute ( request ) : if request . method == 'POST' : missing_keys = False missing_keys_error = "Missing keys: " for key in [ 'graph_id' , 'vx_id' , 'label' , 'value' ] : if key not in request . data : missing_keys_error = missing_keys_error + key + " " missing_keys = True if missing_keys : return Response ( { "Error" : missing_keys_error , "data" : request . data } ) try : graph_fk = request . data [ 'graph_id' ] vx_id = request . data [ 'vx_id' ] label = request . data [ 'label' ] value = request . data [ 'value' ] vertex = Vertex . objects . filter ( graph_fk_id = graph_fk , vx_id = vx_id ) . last ( ) if vertex is None : return Response ( { "Info" : "Could not find vertex with supplied graph_fk" + " and vx_id values" , "data" : request . data } ) print ( "## DEBUG Vertex=" + str ( vertex ) ) attribute = VertexAttrib . objects . filter ( vertex_fk = vertex , attrib_fk__label = label ) . last ( ) if attribute is None : graph = vertex . graph_fk vertex_attribute = graph . graphvertexattrib_set . all ( ) . filter ( label = label ) . last ( ) if vertex_attribute is None : return Response ( { "Info" : "Could not find attribute with supplied label for " + "selected vertex" , "data" : request . data } ) else : attribute = VertexAttrib ( vertex_fk = vertex , attrib_fk = vertex_attribute ) __update_vertex_attribute ( attribute , value ) except Exception as e : return Response ( { "Error" : "An exception occured processing request" , "data" : request . data } ) return Response ( { "Info" : "Found all keys" , "data" : request . data } )
short_docstring: Allow a vertex attribute to be added, or edited based on its containing
  graph and vertex.
short_docstring_tokens: Allow a vertex attribute to be added or edited based on its containing graph and vertex .
comment: """
      Allow a vertex attribute to be added, or edited based on its containing
      graph and vertex.
      Body of POST should be of the form:
          {"graph_id": 3, "vx_id": 0, "label": "x", "value": 1.0}
      Where graph_id and vx_id identify the parent graph/vertex, label is the name
      of the attribute being modified and value is the value to change it to.
      """$SEP$# Ensure post has graph_id, vx_id, label, value$SEP$# Get parent Vertex$SEP$# See if a vertex attribute is defined for the graph with this label$SEP$# Set value