from django.contrib import admin

from wafer.pages.models import File, Page


class PageAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("name",)}
    list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')


admin.site.register(Page, PageAdmin)
admin.site.register(File)

from django.contrib import admin

from wafer.pages.models import File, Page

from reversion.admin import VersionAdmin


class PageAdmin(VersionAdmin, admin.ModelAdmin):
    prepopulated_fields = {"slug": ("name",)}
    list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')


admin.site.register(Page, PageAdmin)
admin.site.register(File)

Add reversion support to Pages
Add reversion support to Pages

  from django.contrib import admin
  
  from wafer.pages.models import File, Page
  
+ from reversion.admin import VersionAdmin
  
+ 
- class PageAdmin(admin.ModelAdmin):
+ class PageAdmin(VersionAdmin, admin.ModelAdmin):
      prepopulated_fields = {"slug": ("name",)}
      list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')
  
  
  admin.site.register(Page, PageAdmin)
  admin.site.register(File)
  
Add reversion support to Pages
## Code Before:
from django.contrib import admin

from wafer.pages.models import File, Page


class PageAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("name",)}
    list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')


admin.site.register(Page, PageAdmin)
admin.site.register(File)

## Instruction:
Add reversion support to Pages
## Code After:
from django.contrib import admin

from wafer.pages.models import File, Page

from reversion.admin import VersionAdmin


class PageAdmin(VersionAdmin, admin.ModelAdmin):
    prepopulated_fields = {"slug": ("name",)}
    list_display = ('name', 'slug', 'get_people_display_names', 'get_in_schedule')


admin.site.register(Page, PageAdmin)
admin.site.register(File)
