from django.contrib import admin

from .models import Release


class ReleaseAdmin(admin.ModelAdmin):
    list_display = ('version', 'date', 'major', 'minor', 'micro', 'show_status', 'iteration')
    ordering = ('-major', '-minor', '-micro', '-status', '-iteration')

    def show_status(self, obj):
        return obj.get_status_display()
    show_status.admin_order_field = 'status'
    show_status.short_description = 'status'


admin.site.register(Release, ReleaseAdmin)

@@ -424,16 +424,257 @@
 tatus'%0A%0A
+    # Hack -- disable logging because it crashes on the non-integer pk%0A    def log_addition(self, request, object): pass%0A    def log_change(self, request, object, message): pass%0A    def log_deletion(self, request, object, object_repr): pass%0A
 %0Aadmin.s

Revert "Removed hack to disable admin logging for releases app."