from django.contrib import admin
from .models import PillowError


class PillowErrorAdmin(admin.ModelAdmin):

    model = PillowError
    list_display = [
        'pillow',
        'doc_id',
        'error_type',
        'date_created',
        'date_last_attempt',
        'date_next_attempt'
    ]
    list_filter = ('pillow', 'error_type')


admin.site.register(PillowError, PillowErrorAdmin)

from django.contrib import admin

from pillow_retry.models import PillowError


@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):

    model = PillowError
    list_display = [
        'pillow',
        'doc_id',
        'error_type',
        'date_created',
        'date_last_attempt',
        'date_next_attempt'
    ]
    list_filter = ('pillow', 'error_type')
    actions = [
        'delete_selected'
    ]

Add delete action to PillowRetry
Add delete action to PillowRetry

  from django.contrib import admin
+ 
- from .models import PillowError
+ from pillow_retry.models import PillowError
  
  
+ @admin.register(PillowError)
  class PillowErrorAdmin(admin.ModelAdmin):
  
      model = PillowError
      list_display = [
          'pillow',
          'doc_id',
          'error_type',
          'date_created',
          'date_last_attempt',
          'date_next_attempt'
      ]
      list_filter = ('pillow', 'error_type')
+     actions = [
+         'delete_selected'
+     ]
  
- 
- admin.site.register(PillowError, PillowErrorAdmin)
- 
Add delete action to PillowRetry
## Code Before:
from django.contrib import admin
from .models import PillowError


class PillowErrorAdmin(admin.ModelAdmin):

    model = PillowError
    list_display = [
        'pillow',
        'doc_id',
        'error_type',
        'date_created',
        'date_last_attempt',
        'date_next_attempt'
    ]
    list_filter = ('pillow', 'error_type')


admin.site.register(PillowError, PillowErrorAdmin)

## Instruction:
Add delete action to PillowRetry
## Code After:
from django.contrib import admin

from pillow_retry.models import PillowError


@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):

    model = PillowError
    list_display = [
        'pillow',
        'doc_id',
        'error_type',
        'date_created',
        'date_last_attempt',
        'date_next_attempt'
    ]
    list_filter = ('pillow', 'error_type')
    actions = [
        'delete_selected'
    ]
