admin.py 2.02 KB
Newer Older
Hervé  MENAGER's avatar
Hervé MENAGER committed
1
from django.contrib import admin
2
from .models import *
3
from django.apps import apps
Hervé  MENAGER's avatar
Hervé MENAGER committed
4

Hervé  MENAGER's avatar
Hervé MENAGER committed
5

6
7
@admin.register(Bibliography)
class BibliographyAdmin(admin.ModelAdmin):
Hervé  MENAGER's avatar
Hervé MENAGER committed
8
9
10
    list_display = ('authors_list', 'title',
                    'journal_name', 'biblio_year', 'id_source')

11

12
13
14
15
@admin.register(Protein)
class ProteinAdmin(admin.ModelAdmin):
    list_display = ('uniprot_id', 'recommended_name_long')

Hervé  MENAGER's avatar
Hervé MENAGER committed
16

17
18
19
20
@admin.register(Taxonomy)
class TaxonomyAdmin(admin.ModelAdmin):
    list_display = ('taxonomy_id', 'name')

Hervé  MENAGER's avatar
Hervé MENAGER committed
21

22
23
24
25
@admin.register(Domain)
class DomainAdmin(admin.ModelAdmin):
    list_display = ('pfam_acc', 'pfam_id', 'pfam_description', 'domain_family')

Hervé  MENAGER's avatar
Hervé MENAGER committed
26

27
28
@admin.register(ProteinDomainBoundComplex)
class ProteinDomainBoundComplexAdmin(admin.ModelAdmin):
29
    list_display = ('protein', 'domain', 'ppc_copy_nb', 'ppp_copy_nb_per_p')
Hervé  MENAGER's avatar
Hervé MENAGER committed
30
31
32
    list_display_links = (
        'protein', 'domain', 'ppc_copy_nb', 'ppp_copy_nb_per_p')

33
34
35

@admin.register(ProteinDomainPartnerComplex)
class ProteinDomainPartnerComplexAdmin(admin.ModelAdmin):
36
37
    list_display = ('protein', 'domain', 'ppc_copy_nb')
    list_display_links = ('protein', 'domain', 'ppc_copy_nb')
38

Hervé  MENAGER's avatar
Hervé MENAGER committed
39

40
41
42
43
@admin.register(Symmetry)
class Symmetry(admin.ModelAdmin):
    list_display = ('code', 'description')

Hervé  MENAGER's avatar
Hervé MENAGER committed
44

45
46
47
48
@admin.register(MDDRCompoundImport)
class MDDRCompoundImport(admin.ModelAdmin):
    list_display = ('mddr_name', 'dvpmt_phase', 'canonical_smile')

Hervé  MENAGER's avatar
Hervé MENAGER committed
49

50
51
52
53
@admin.register(Compound)
class Compound(admin.ModelAdmin):
    list_display = ('iupac_name', 'common_name', 'canonical_smile')

Hervé  MENAGER's avatar
Hervé MENAGER committed
54

55
56
57
58
@admin.register(TestActivityDescription)
class TextActivityDescription(admin.ModelAdmin):
    list_display = ('test_name', 'test_type', 'test_modulation_type')

59
for model in apps.get_app_config('ippidb').models.values():
60
61
62
63
    try:
        admin.site.register(model)
    except admin.sites.AlreadyRegistered as are:
        continue
64

Hervé  MENAGER's avatar
Hervé MENAGER committed
65
admin.site.site_header = 'iPPI-DB website administration'
66
67
68

admin.site.site_title = admin.site.site_header

Hervé  MENAGER's avatar
Hervé MENAGER committed
69
70
71
admin.site.index_header = 'iPPI-DB administration'

admin.site.index_title = admin.site.index_header