コード例 #1
0
 def __init__(self, request, *args, **kwargs):
     super(SelectTemplateForm, self).__init__(request, *args, **kwargs)
     templates = network_template_api.get_network_templates()
     field_templates = []
     if templates:
         field_templates.append(
             ('default', _('--- Select Network Template ---')))
         for template in templates:
             field_templates.append(
                 (template.id, _(template.template_name)))
     else:
         field_templates.append(
             ('default', _('--- No Available Templates  ---')))
     self.fields['network_templates'].choices = field_templates
コード例 #2
0
ファイル: forms.py プロジェクト: bigswitch/horizon
 def __init__(self, request, *args, **kwargs):
     super(SelectTemplateForm, self).__init__(request, *args, **kwargs)
     templates = network_template_api.get_network_templates()
     field_templates = []
     if templates:
         field_templates.append(
             ('default', _('--- Select Network Template ---')))
         for template in templates:
             field_templates.append(
                 (template.id, _(template.template_name)))
     else:
         field_templates.append(
             ('default', _('--- No Available Templates  ---')))
     self.fields['network_templates'].choices = field_templates
コード例 #3
0
 def get_networktemplate_admin_data(self):
     return network_template_api.get_network_templates()
コード例 #4
0
ファイル: tabs.py プロジェクト: bigswitch/horizon
 def get_networktemplate_admin_data(self):
     return network_template_api.get_network_templates()