Sort templates alphabetically
And also select the chosen template as the default one
This commit is contained in:
		
					parent
					
						
							
								768f3532f7
							
						
					
				
			
			
				commit
				
					
						a02c3c6973
					
				
			
		
					 2 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -92,11 +92,14 @@ class DCLCalculatorPlugin(CMSPluginBase):
 | 
			
		|||
        if ids:
 | 
			
		||||
            context['templates'] = VMTemplate.objects.filter(
 | 
			
		||||
                vm_type=instance.vm_type
 | 
			
		||||
            ).filter(opennebula_vm_template_id__in=ids)
 | 
			
		||||
            ).filter(opennebula_vm_template_id__in=ids).order_by('name')
 | 
			
		||||
        else:
 | 
			
		||||
            context['templates'] = VMTemplate.objects.filter(
 | 
			
		||||
                vm_type=instance.vm_type
 | 
			
		||||
            )
 | 
			
		||||
            ).order_by('name')
 | 
			
		||||
        context['default_selected_template'] = (
 | 
			
		||||
            instance.default_selected_template
 | 
			
		||||
        )
 | 
			
		||||
        return context
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue