Commit 11051553 by carpoon

add export target filed

parent 724e1aa1
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
# #
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with CIRCLE. If not, see <http://www.gnu.org/licenses/>. # with CIRCLE. If not, see <http://www.gnu.org/licenses/>.
from urllib.parse import urlparse from urllib.parse import urlparse
import os import os
...@@ -877,13 +874,15 @@ class VmDiskExportForm(OperationForm): ...@@ -877,13 +874,15 @@ class VmDiskExportForm(OperationForm):
disk_format = forms.ChoiceField( disk_format = forms.ChoiceField(
choices=Disk.EXPORT_FORMATS, choices=Disk.EXPORT_FORMATS,
label=_('Format')) label=_('Format'))
export_target = forms.ChoiceField(
choices=(('user_store', 'User store'), ('datastore', 'Datastore')),
label=_('Export target'))
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
choices = kwargs.pop('choices') choices = kwargs.pop('choices')
self.disk = kwargs.pop('default') self.disk = kwargs.pop('default')
super(VmDiskExportForm, self).__init__(*args, **kwargs) super(VmDiskExportForm, self).__init__(*args, **kwargs)
self.fields['disk'] = forms.ModelChoiceField( self.fields['disk'] = forms.ModelChoiceField(
queryset=choices, initial=self.disk, required=True, queryset=choices, initial=self.disk, required=True,
empty_label=None, label=_('Disk')) empty_label=None, label=_('Disk'))
...@@ -902,7 +901,8 @@ class VmDiskExportForm(OperationForm): ...@@ -902,7 +901,8 @@ class VmDiskExportForm(OperationForm):
), ),
Field('disk'), Field('disk'),
Field('exported_name'), Field('exported_name'),
Field('disk_format') Field('disk_format'),
Field('export_target'),
) )
return helper return helper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment