forked from treeio/treeio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.py
38 lines (32 loc) · 1012 Bytes
/
admin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Documents Admin
"""
from treeio.documents.models import Folder, File, Document, WebLink
from django.contrib import admin
class FolderAdmin(admin.ModelAdmin):
"FolderAdmin"
list_display = ('name', 'parent')
search_fields = ['name']
class FileAdmin(admin.ModelAdmin):
"FileAdmin"
list_display = ('name', 'folder')
list_filter = ['folder']
search_fields = ['name']
class DocumentAdmin(admin.ModelAdmin):
"DocumentAdmin"
list_display = ('title', 'folder')
list_filter = ['folder']
search_fields = ['title']
class WebLinkAdmin(admin.ModelAdmin):
"WeblinkAdmin"
list_display = ('title', 'folder', 'url')
list_filter = ['folder']
search_fields = ['title']
admin.site.register(Folder, FolderAdmin)
admin.site.register(File, FileAdmin)
admin.site.register(Document, DocumentAdmin)
admin.site.register(WebLink, WebLinkAdmin)