mirror of
https://github.com/retspen/webvirtmgr.git
synced 2026-04-26 08:05:54 +03:00
[GH-ISSUE #95] Unable to access dictionay in /storage/views.py from storage.html #79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @swatcat on GitHub (Aug 2, 2013).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/95
I am a newbie to Django and struggling with it. So this is what I am trying to do:
I do a POST.get to get value of "directorypath" from the UI.
file_info=volumes_by_path(path)
This will return a dictionary with key as filename and values as (filesize, fileformat).
Now I need to use file_info and print all the values in the table. I tried doin this the way u had done for "Add Image". Same html code, same way u loop through the dictionary. But the storage.html file is not able to access "file_info" in views.py.
This is what I have in views.py:
if 'addimg' in request.POST:
........
........
if 'cloneaddimg' in request.POST:
name = request.POST.get('name','')
path = request.POST.get('path','')
I would really appreciate if you could help me with this asap. I want to use this file_info and simply print it in the table they way u doing it.
Thank you in advance.
@swatcat commented on GitHub (Aug 2, 2013):
Figured out the problem. WHen I click on the submit button after entering value for a path in the form, the views.py for some reason gets refreshed twice and hence the data wipes out and nothing gets displayed on the screen.
Any idea why this is happening and how it can be fixed?
Thank you
@retspen commented on GitHub (Aug 5, 2013):
Commet all lines where 'return HttpResponseRedirect' for test. What happen?
@swatcat commented on GitHub (Aug 6, 2013):
I tried that but nothing changed. I did a work around. wrote requesr.session["vol"] = dictionaryname
and then inputing all the values to db and doing a select. Its a patch.
Now I intend to copy a disk from the machine where I have webvirtmgr running to a hypervisor. Basically I am providing the user option of selecting an existing image from their machine (where webvirtmgr is deployed) and then copy that image to the hypervisor for launchin a VM.
Can you suggest as to how to achieve this. I dont find any command online neither there is a libvirt function which can do this.
I would appreciate if you could reply back ASAP.
Thank you for all your help.
@retspen commented on GitHub (Aug 7, 2013):
I understand you modify the panel to fit your needs or webvirtmgr does not work?