from django.contrib import admin
from us_ignite.awards.models import Award


class AwardAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')

admin.site.register(Award, AwardAdmin)

from django.contrib import admin
from us_ignite.awards.models import Award, ApplicationAward


class AwardAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')


class ApplicationAwardAdmin(admin.ModelAdmin):
    list_display = ('award', 'application', 'created')
    date_hierarchy = 'created'
    list_filter = ('award__name',)

admin.site.register(Award, AwardAdmin)
admin.site.register(ApplicationAward, ApplicationAwardAdmin)

Add mechanics to award applications.
Add mechanics to award applications.

https://github.com/madewithbytes/us_ignite/issues/77

The awards can be given in the admin section.

  from django.contrib import admin
- from us_ignite.awards.models import Award
+ from us_ignite.awards.models import Award, ApplicationAward
  
  
  class AwardAdmin(admin.ModelAdmin):
      list_display = ('name', 'slug')
  
+ 
+ class ApplicationAwardAdmin(admin.ModelAdmin):
+     list_display = ('award', 'application', 'created')
+     date_hierarchy = 'created'
+     list_filter = ('award__name',)
+ 
  admin.site.register(Award, AwardAdmin)
+ admin.site.register(ApplicationAward, ApplicationAwardAdmin)
  
Add mechanics to award applications.
## Code Before:
from django.contrib import admin
from us_ignite.awards.models import Award


class AwardAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')

admin.site.register(Award, AwardAdmin)

## Instruction:
Add mechanics to award applications.
## Code After:
from django.contrib import admin
from us_ignite.awards.models import Award, ApplicationAward


class AwardAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')


class ApplicationAwardAdmin(admin.ModelAdmin):
    list_display = ('award', 'application', 'created')
    date_hierarchy = 'created'
    list_filter = ('award__name',)

admin.site.register(Award, AwardAdmin)
admin.site.register(ApplicationAward, ApplicationAwardAdmin)
