2010-07-12 14:56:14 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
|
|
|
|
|
|
|
from django.contrib import admin
|
|
|
|
|
2010-12-23 07:55:44 +00:00
|
|
|
from forms import FileAdminForm, InstanceAdminForm
|
2010-07-12 14:56:14 +00:00
|
|
|
import models
|
|
|
|
|
2011-01-01 11:44:42 +00:00
|
|
|
|
2010-07-12 14:56:14 +00:00
|
|
|
class FileAdmin(admin.ModelAdmin):
|
2011-04-06 18:57:25 +00:00
|
|
|
search_fields = ['name', 'folder','oshash', 'video_codec']
|
2011-08-23 17:39:34 +00:00
|
|
|
list_display = ['available', 'wanted', 'active', '__unicode__', 'itemId']
|
2010-12-23 07:55:44 +00:00
|
|
|
list_display_links = ('__unicode__', )
|
2010-07-12 14:56:14 +00:00
|
|
|
|
2010-12-23 07:55:44 +00:00
|
|
|
def itemId(self, obj):
|
|
|
|
return '%s'%(obj.item.itemId)
|
|
|
|
|
|
|
|
form = FileAdminForm
|
2010-07-12 14:56:14 +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):
|
2011-04-06 18:57:25 +00:00
|
|
|
search_fields = ['name', 'folder', 'volume__name', 'file__oshash']
|
2010-12-23 07:55:44 +00:00
|
|
|
form = InstanceAdminForm
|
2010-07-12 14:56:14 +00:00
|
|
|
|
2010-11-08 17:43:59 +00:00
|
|
|
admin.site.register(models.Instance, InstanceAdmin)
|