source: telemeta/admin.py @ fabced9

cremcrem2crem3devdev2diademsdj1.6feature/breadcrumbsfeature/ts-0.5feature/ts-0.5.4feature/writecacheformagenericinstru_searchlamlam2mapsv3mergenlivemultiprobproductionrelease/1.4.4sabiodsearchsecurityserversocialstoragetelecastertest
Last change on this file since fabced9 was fabced9, checked in by yomguy <yomguy@…>, 3 years ago

add extra blocks, horizontal window for children in admin

  • Property mode set to 100644
File size: 3.1 KB
Line 
1# -*- coding: utf-8 -*-
2from telemeta.models.media import *
3from telemeta.models.instrument import *
4from telemeta.models.location import *
5from telemeta.models.language import *
6from telemeta.models.system import *
7from django.contrib import admin
8
9class MediaFondsAdmin(admin.ModelAdmin):
10    search_fields = ['title', 'code']
11    ordering = ['code']
12    filter_horizontal = ['children']
13
14class MediaCorpusAdmin(admin.ModelAdmin):
15    search_fields = ['title', 'code']
16    ordering = ['code']
17    filter_horizontal = ['children']
18   
19class MediaCollectionAdmin(admin.ModelAdmin):
20    search_fields = ['title', 'code']
21    ordering = ['code']
22
23class MediaCollectionRelatedAdmin(admin.ModelAdmin):
24    search_fields = ['title', 'description']
25
26class MediaItemAdmin(admin.ModelAdmin):
27    search_fields = ['title', 'code']
28    ordering = ['code']
29    exclude = ('copied_from_item', )
30
31class MediaItemRelatedAdmin(admin.ModelAdmin):
32    search_fields = ['title', 'description']
33
34class MediaPartAdmin(admin.ModelAdmin):
35    search_fields = ['title', 'item__code']
36    ordering = ['title']
37
38class InstrumentAdmin(admin.ModelAdmin):
39    search_fields = ['name']
40    ordering = ['name']
41
42class InstrumentAliasAdmin(admin.ModelAdmin):
43    search_fields = ['name']
44    ordering = ['name']
45
46class InstrumentRelationAdmin(admin.ModelAdmin):
47    search_fields = ['instrument__name', 'parent_instrument__name']
48    ordering = ['parent_instrument__name']
49
50class InstrumentAliasRelationAdmin(admin.ModelAdmin):
51    search_fields = ['alias__name', 'instrument__name']
52    ordering = ['alias__name']
53
54class LocationAdmin(admin.ModelAdmin):
55    search_fields = ['name']
56    ordering = ['name']
57
58class LocationAliasAdmin(admin.ModelAdmin):
59    search_fields = ['location__name', 'alias']
60    ordering = ['alias']
61
62class LocationRelationAdmin(admin.ModelAdmin):
63    search_fields = ['location__name', 'ancestor_location__name']
64    ordering = ['ancestor_location__name']
65
66class LanguageAdmin(admin.ModelAdmin):
67    search_fields = ['name', 'identifier']
68    ordering = ['name']
69
70class RevisionAdmin(admin.ModelAdmin):
71    search_fields = ['element_id', 'user']
72    ordering = ['-time']
73
74class FormatAdmin(admin.ModelAdmin):
75    search_fields = ['code', 'vendor']
76
77admin.site.register(MediaFonds, MediaFondsAdmin)
78admin.site.register(MediaCorpus, MediaCorpusAdmin)
79admin.site.register(MediaCollection, MediaCollectionAdmin)
80admin.site.register(MediaItem, MediaItemAdmin)
81admin.site.register(MediaPart, MediaPartAdmin)
82
83admin.site.register(MediaItemRelated, MediaItemRelatedAdmin)
84admin.site.register(MediaCollectionRelated, MediaCollectionRelatedAdmin)
85
86admin.site.register(Instrument, InstrumentAdmin)
87admin.site.register(InstrumentAlias, InstrumentAliasAdmin)
88admin.site.register(InstrumentRelation, InstrumentRelationAdmin)
89admin.site.register(InstrumentAliasRelation, InstrumentAliasRelationAdmin)
90
91admin.site.register(Location, LocationAdmin)
92#admin.site.register(LocationType)
93admin.site.register(LocationAlias, LocationAliasAdmin)
94admin.site.register(LocationRelation, LocationRelationAdmin)
95
96admin.site.register(Language, LanguageAdmin)
97
98admin.site.register(Revision, RevisionAdmin)
99
100admin.site.register(Format, FormatAdmin)
Note: See TracBrowser for help on using the repository browser.