mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	Merge 'detail' tables into primaries for each model
This commit is contained in:
		@@ -10,7 +10,6 @@ from utilities.tables import (
 | 
			
		||||
 | 
			
		||||
__all__ = (
 | 
			
		||||
    'RackTable',
 | 
			
		||||
    'RackDetailTable',
 | 
			
		||||
    'RackReservationTable',
 | 
			
		||||
    'RackRoleTable',
 | 
			
		||||
)
 | 
			
		||||
@@ -56,17 +55,6 @@ class RackTable(BaseTable):
 | 
			
		||||
        template_code="{{ record.u_height }}U",
 | 
			
		||||
        verbose_name='Height'
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    class Meta(BaseTable.Meta):
 | 
			
		||||
        model = Rack
 | 
			
		||||
        fields = (
 | 
			
		||||
            'pk', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'role', 'serial', 'asset_tag', 'type',
 | 
			
		||||
            'width', 'u_height',
 | 
			
		||||
        )
 | 
			
		||||
        default_columns = ('pk', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'role', 'u_height')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class RackDetailTable(RackTable):
 | 
			
		||||
    comments = MarkdownColumn()
 | 
			
		||||
    device_count = LinkedCountColumn(
 | 
			
		||||
        viewname='dcim:device_list',
 | 
			
		||||
@@ -85,7 +73,8 @@ class RackDetailTable(RackTable):
 | 
			
		||||
        url_name='dcim:rack_list'
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    class Meta(RackTable.Meta):
 | 
			
		||||
    class Meta(BaseTable.Meta):
 | 
			
		||||
        model = Rack
 | 
			
		||||
        fields = (
 | 
			
		||||
            'pk', 'name', 'site', 'location', 'status', 'facility_id', 'tenant', 'role', 'serial', 'asset_tag', 'type',
 | 
			
		||||
            'width', 'u_height', 'comments', 'device_count', 'get_utilization', 'get_power_utilization', 'tags',
 | 
			
		||||
 
 | 
			
		||||
@@ -455,6 +455,8 @@ class RackRoleView(generic.ObjectView):
 | 
			
		||||
 | 
			
		||||
        racks_table = tables.RackTable(racks)
 | 
			
		||||
        racks_table.columns.hide('role')
 | 
			
		||||
        racks_table.columns.hide('get_utilization')
 | 
			
		||||
        racks_table.columns.hide('get_power_utilization')
 | 
			
		||||
        paginate_table(racks_table, request)
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
@@ -505,7 +507,7 @@ class RackListView(generic.ObjectListView):
 | 
			
		||||
    )
 | 
			
		||||
    filterset = filtersets.RackFilterSet
 | 
			
		||||
    filterset_form = forms.RackFilterForm
 | 
			
		||||
    table = tables.RackDetailTable
 | 
			
		||||
    table = tables.RackTable
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class RackElevationListView(generic.ObjectListView):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user