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
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
def get_networktemplate_admin_data(self): return network_template_api.get_network_templates()
def get_networktemplate_admin_data(self): return network_template_api.get_network_templates()