Adding a parameter while saving the postgres query
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.
I am working on the HUE for my project, i have to save a parameter along with the metadatas while creating a postgres query,i have added my parameter in the client post request by altering the "notebook.ko.js" file present in the "/hue/desktop/libs/notebook/src/notebook/static/notebook/js/" location, now i have to save that parameter in the "desktop_document2" database table ,for that i have altered the code in "api.py" file present in the /hue/desktop/libs/notebook/src/notebook/ location,i altered the code in api.py as follows.
if notebook.get('parentSavedQueryUuid'): # We save into the original saved query, not into the query history notebook_doc = Document2.objects.get_by_uuid(user=user, uuid=notebook['parentSavedQueryUuid']) elif notebook.get('id'): notebook_doc = Document2.objects.get(id=notebook['id']) else: notebook_doc = Document2.objects.create(name=notebook['name'], uuid=notebook['uuid'], type=notebook_type, owner=user) Document.objects.link(notebook_doc, owner=notebook_doc.owner, name=notebook_doc.name, description=notebook_doc.description, extra=notebook_type) save_as = True