from django.contrib import admin

from nodeconductor.logging import models


class AlertAdmin(admin.ModelAdmin):
    list_display = ('uuid', 'alert_type', 'closed', 'scope', 'severity')
    ordering = ('alert_type',)
    base_model = models.Alert

admin.site.register(models.Alert, AlertAdmin)

from django.contrib import admin

from nodeconductor.logging import models


class AlertAdmin(admin.ModelAdmin):
    list_display = ('uuid', 'alert_type', 'created', 'closed', 'scope', 'severity')
    list_filter = ('alert_type', 'created', 'closed', 'severity')
    ordering = ('alert_type',)
    base_model = models.Alert

admin.site.register(models.Alert, AlertAdmin)

Add list filtering for alerts
Add list filtering for alerts

  from django.contrib import admin
  
  from nodeconductor.logging import models
  
  
  class AlertAdmin(admin.ModelAdmin):
-     list_display = ('uuid', 'alert_type', 'closed', 'scope', 'severity')
+     list_display = ('uuid', 'alert_type', 'created', 'closed', 'scope', 'severity')
+     list_filter = ('alert_type', 'created', 'closed', 'severity')
      ordering = ('alert_type',)
      base_model = models.Alert
  
  admin.site.register(models.Alert, AlertAdmin)
  
Add list filtering for alerts
## Code Before:
from django.contrib import admin

from nodeconductor.logging import models


class AlertAdmin(admin.ModelAdmin):
    list_display = ('uuid', 'alert_type', 'closed', 'scope', 'severity')
    ordering = ('alert_type',)
    base_model = models.Alert

admin.site.register(models.Alert, AlertAdmin)

## Instruction:
Add list filtering for alerts
## Code After:
from django.contrib import admin

from nodeconductor.logging import models


class AlertAdmin(admin.ModelAdmin):
    list_display = ('uuid', 'alert_type', 'created', 'closed', 'scope', 'severity')
    list_filter = ('alert_type', 'created', 'closed', 'severity')
    ordering = ('alert_type',)
    base_model = models.Alert

admin.site.register(models.Alert, AlertAdmin)
