Commit 77cb1b9c by Kálmán Viktor

dashboard: default ordering of interfaces by managed attr

parent ef4fa009
...@@ -215,7 +215,7 @@ class VmDetailView(CheckedDetailView): ...@@ -215,7 +215,7 @@ class VmDetailView(CheckedDetailView):
context['vlans'] = Vlan.get_objects_with_level( context['vlans'] = Vlan.get_objects_with_level(
'user', self.request.user 'user', self.request.user
).exclude( ).exclude( # exclude already added interfaces
pk__in=Interface.objects.filter( pk__in=Interface.objects.filter(
instance=self.get_object()).values_list("vlan", flat=True) instance=self.get_object()).values_list("vlan", flat=True)
).all() ).all()
......
...@@ -53,6 +53,7 @@ class Interface(Model): ...@@ -53,6 +53,7 @@ class Interface(Model):
class Meta: class Meta:
app_label = 'vm' app_label = 'vm'
db_table = 'vm_interface' db_table = 'vm_interface'
ordering = ("-vlan__managed", )
def __unicode__(self): def __unicode__(self):
return 'cloud-' + str(self.instance.id) + '-' + str(self.vlan.vid) return 'cloud-' + str(self.instance.id) + '-' + str(self.vlan.vid)
......
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