pandora/pandora/archive/admin.py

25 lines
629 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from django.contrib import admin
from . import models
2011-01-01 11:44:42 +00:00
class FileAdmin(admin.ModelAdmin):
2016-07-01 15:41:53 +00:00
search_fields = ['path', 'oshash', 'video_codec']
2017-04-15 10:28:11 +00:00
list_display = ['available', 'wanted', 'selected', '__str__', 'public_id']
list_display_links = ('__str__', )
2014-09-19 12:26:46 +00:00
def public_id(self, obj):
2016-07-01 15:41:53 +00:00
return '%s' % (obj.item.public_id)
2010-12-23 07:55:44 +00:00
admin.site.register(models.File, FileAdmin)
2011-01-01 11:44:42 +00:00
2010-11-08 17:43:59 +00:00
class InstanceAdmin(admin.ModelAdmin):
search_fields = ['path', 'volume__name', 'file__oshash']
2010-11-08 17:43:59 +00:00
admin.site.register(models.Instance, InstanceAdmin)