05a0a7c976fab9bc2f92f8b891316de64bfda983
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / savoirs / admin.py
1 # -*- encoding: utf-8 -*-
2 from django.contrib import admin
3 from models import SourceActualite, Actualite, Discipline, Evenement, Record
4 from savoirs.lib.backend import Backend
5
6 admin.site.register(Actualite)
7 admin.site.register(SourceActualite)
8 admin.site.register(Discipline)
9 admin.site.register(Evenement)
10
11
12 class RecordAdmin(admin.ModelAdmin):
13 list_filter = ('server',)
14 list_display = (
15 #OAI et extra AUF
16 'title',
17 'subject',
18 '_description',
19 '_uri',
20 #'server',
21 'identifier',
22 #'source',
23 'modified',
24 'creator',
25 'contributor',
26 'language',
27 'publisher',
28 'format',
29 'type',
30
31 #SEP 2 (aucune données récoltées)
32 #'alt_title',
33 #'abstract',
34 #'creation',
35 #'issued',
36 #'isbn',
37 #'orig_lang',
38 )
39
40 def _uri(self, obj):
41 """ """
42 return "<a target='_blank' href='%s'>%s</a>" % (obj.uri, obj.uri)
43 _uri.allow_tags = True
44
45 def _description(self, obj):
46 """ """
47 return "%s..." % obj.description[:140]
48
49 admin.site.register(Record, RecordAdmin)
50