from django.contrib import admin

from .models import Attachment, Letter


class AttachmentInline(admin.StackedInline):
    '''
        Stacked Inline View for Attachment
    '''
    model = Attachment


class LetterAdmin(admin.ModelAdmin):
    '''
        Admin View for Letter
    '''
    inlines = [
        AttachmentInline,
    ]

admin.site.register(Letter, LetterAdmin)

from django.contrib import admin

from .models import Attachment, Letter


class AttachmentInline(admin.StackedInline):
    '''
        Stacked Inline View for Attachment
    '''
    model = Attachment


@admin.register(Letter)
class LetterAdmin(admin.ModelAdmin):
    '''
        Admin View for Letter
    '''
    inlines = [
        AttachmentInline,
    ]

Rewrite DjangoAdmin in letters for decorators
Rewrite DjangoAdmin in letters for decorators

  from django.contrib import admin
  
  from .models import Attachment, Letter
  
  
  class AttachmentInline(admin.StackedInline):
      '''
          Stacked Inline View for Attachment
      '''
      model = Attachment
  
  
+ @admin.register(Letter)
  class LetterAdmin(admin.ModelAdmin):
      '''
          Admin View for Letter
      '''
      inlines = [
          AttachmentInline,
      ]
  
- admin.site.register(Letter, LetterAdmin)
- 
Rewrite DjangoAdmin in letters for decorators
## Code Before:
from django.contrib import admin

from .models import Attachment, Letter


class AttachmentInline(admin.StackedInline):
    '''
        Stacked Inline View for Attachment
    '''
    model = Attachment


class LetterAdmin(admin.ModelAdmin):
    '''
        Admin View for Letter
    '''
    inlines = [
        AttachmentInline,
    ]

admin.site.register(Letter, LetterAdmin)

## Instruction:
Rewrite DjangoAdmin in letters for decorators
## Code After:
from django.contrib import admin

from .models import Attachment, Letter


class AttachmentInline(admin.StackedInline):
    '''
        Stacked Inline View for Attachment
    '''
    model = Attachment


@admin.register(Letter)
class LetterAdmin(admin.ModelAdmin):
    '''
        Admin View for Letter
    '''
    inlines = [
        AttachmentInline,
    ]
