original_docstring: 
      Allow a transaction attribute to be added, or edited based on its containing
      graph and transaction.
      Body of POST should be of the form:
          {"graph_id": 3, "tx_id": 0, "label": "x", "value": 1.0}
      Where graph_id and tx_id identify the parent graph/transaction, label is the
      name of the attribute being modified and value is the value to change it to.
      
docstring: Allow a transaction attribute to be added, or edited based on its containing
  graph and transaction.
docstring_tokens: Allow a transaction attribute to be added or edited based on its containing graph and transaction .
code: def EditTransactionAttribute(request):
      """
      Allow a transaction attribute to be added, or edited based on its containing
      graph and transaction.
      Body of POST should be of the form:
          {"graph_id": 3, "tx_id": 0, "label": "x", "value": 1.0}
      Where graph_id and tx_id identify the parent graph/transaction, 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, tx_id, label, value
          missing_keys = False
          missing_keys_error = "Missing keys: "
          for key in ['graph_id', 'tx_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']
              tx_id = request.data['tx_id']
              label = request.data['label']
              value = request.data['value']
  
              # Get parent Transaction
              transaction = Transaction.objects.filter(graph_fk_id=graph_fk, tx_id=tx_id).last()
              if transaction is None:
                  # See if a transaction attribute is defined for the graph with this label
                  graph = transaction.graph_fk
                  transaction_attribute = graph.graphtransactionattrib_set.all().filter(label=label).last()
                  if transaction_attribute is None:
                      return Response({"Info": "Could not find attribute with supplied label for " +
                                               "selected transaction", "data": request.data})
                  else:
                      attribute = VertexAttrib(transaction_fk=transaction, attrib_fk=transaction_attribute)
  
              # Set value
              __update_transaction_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 EditTransactionAttribute ( request ) : if request . method == 'POST' : missing_keys = False missing_keys_error = "Missing keys: " for key in [ 'graph_id' , 'tx_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' ] tx_id = request . data [ 'tx_id' ] label = request . data [ 'label' ] value = request . data [ 'value' ] transaction = Transaction . objects . filter ( graph_fk_id = graph_fk , tx_id = tx_id ) . last ( ) if transaction is None : graph = transaction . graph_fk transaction_attribute = graph . graphtransactionattrib_set . all ( ) . filter ( label = label ) . last ( ) if transaction_attribute is None : return Response ( { "Info" : "Could not find attribute with supplied label for " + "selected transaction" , "data" : request . data } ) else : attribute = VertexAttrib ( transaction_fk = transaction , attrib_fk = transaction_attribute ) __update_transaction_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 transaction attribute to be added, or edited based on its containing
  graph and transaction.
short_docstring_tokens: Allow a transaction attribute to be added or edited based on its containing graph and transaction .
comment: """
      Allow a transaction attribute to be added, or edited based on its containing
      graph and transaction.
      Body of POST should be of the form:
          {"graph_id": 3, "tx_id": 0, "label": "x", "value": 1.0}
      Where graph_id and tx_id identify the parent graph/transaction, label is the
      name of the attribute being modified and value is the value to change it to.
      """$SEP$# Ensure post has graph_id, tx_id, label, value$SEP$# Get parent Transaction$SEP$# See if a transaction attribute is defined for the graph with this label$SEP$# Set value