source: telemeta/admin.py @ 6b3e6e5

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

fix format import

  • Property mode set to 100644
File size: 3.4 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
8from django.contrib.auth.models import User
9from django.contrib.auth.admin import UserAdmin
10
11admin.site.unregister(User)
12
13class MediaFondsAdmin(admin.ModelAdmin):
14    search_fields = ['title', 'code']
15    ordering = ['code']
16    filter_horizontal = ['children']
17
18class MediaCorpusAdmin(admin.ModelAdmin):
19    search_fields = ['title', 'code']
20    ordering = ['code']
21    filter_horizontal = ['children']
22
23class MediaCollectionAdmin(admin.ModelAdmin):
24    search_fields = ['title', 'code']
25    ordering = ['code']
26
27class MediaCollectionRelatedAdmin(admin.ModelAdmin):
28    search_fields = ['title', 'description']
29
30class MediaItemAdmin(admin.ModelAdmin):
31    search_fields = ['title', 'code']
32    ordering = ['code']
33    exclude = ('copied_from_item', )
34
35class MediaItemRelatedAdmin(admin.ModelAdmin):
36    search_fields = ['title', 'description']
37
38class MediaPartAdmin(admin.ModelAdmin):
39    search_fields = ['title', 'item__code']
40    ordering = ['title']
41
42class InstrumentAdmin(admin.ModelAdmin):
43    search_fields = ['name']
44    ordering = ['name']
45
46class InstrumentAliasAdmin(admin.ModelAdmin):
47    search_fields = ['name']
48    ordering = ['name']
49
50class InstrumentRelationAdmin(admin.ModelAdmin):
51    search_fields = ['instrument__name', 'parent_instrument__name']
52    ordering = ['parent_instrument__name']
53
54class InstrumentAliasRelationAdmin(admin.ModelAdmin):
55    search_fields = ['alias__name', 'instrument__name']
56    ordering = ['alias__name']
57
58class LocationAdmin(admin.ModelAdmin):
59    search_fields = ['name']
60    ordering = ['name']
61
62class LocationAliasAdmin(admin.ModelAdmin):
63    search_fields = ['location__name', 'alias']
64    ordering = ['alias']
65
66class LocationRelationAdmin(admin.ModelAdmin):
67    search_fields = ['location__name', 'ancestor_location__name']
68    ordering = ['ancestor_location__name']
69
70class LanguageAdmin(admin.ModelAdmin):
71    search_fields = ['name', 'identifier']
72    ordering = ['name']
73
74class RevisionAdmin(admin.ModelAdmin):
75    search_fields = ['element_id', 'user']
76    ordering = ['-time']
77
78class FormatAdmin(admin.ModelAdmin):
79    search_fields = ['code', 'vendor', 'item__code']
80
81class UserProfileInline(admin.StackedInline):
82        model = UserProfile
83
84class UserProfileAdmin(UserAdmin):
85        inlines = [UserProfileInline]
86
87admin.site.register(MediaFonds, MediaFondsAdmin)
88admin.site.register(MediaCorpus, MediaCorpusAdmin)
89admin.site.register(MediaCollection, MediaCollectionAdmin)
90admin.site.register(MediaItem, MediaItemAdmin)
91admin.site.register(MediaPart, MediaPartAdmin)
92
93admin.site.register(MediaItemRelated, MediaItemRelatedAdmin)
94admin.site.register(MediaCollectionRelated, MediaCollectionRelatedAdmin)
95
96admin.site.register(Instrument, InstrumentAdmin)
97admin.site.register(InstrumentAlias, InstrumentAliasAdmin)
98admin.site.register(InstrumentRelation, InstrumentRelationAdmin)
99admin.site.register(InstrumentAliasRelation, InstrumentAliasRelationAdmin)
100
101admin.site.register(Location, LocationAdmin)
102admin.site.register(LocationType)
103admin.site.register(LocationAlias, LocationAliasAdmin)
104admin.site.register(LocationRelation, LocationRelationAdmin)
105
106admin.site.register(Language, LanguageAdmin)
107
108admin.site.register(Revision, RevisionAdmin)
109
110admin.site.register(Format, FormatAdmin)
111
112admin.site.register(User, UserProfileAdmin)
Note: See TracBrowser for help on using the repository browser.