Coverage for sites/numdam/numdam/admin.py: 100%

26 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2024-07-18 09:02 +0000

1from django.contrib import admin 

2 

3from ptf.models import Article 

4from ptf.models import Collection 

5from ptf.models import Container 

6from ptf.models import Contrib 

7from ptf.models import ContribGroup 

8from ptf.models import ExtLink 

9from ptf.models import Provider 

10from ptf.models import PtfSite 

11 

12 

13class ExtLinkInline(admin.StackedInline): 

14 model = ExtLink 

15 

16 

17class SerialAdmin(admin.ModelAdmin): 

18 inlines = [ExtLinkInline] 

19 ordering = ["title_sort"] 

20 

21 

22@admin.register(Collection) 

23class CollectionAdmin(admin.ModelAdmin): 

24 inlines = [ExtLinkInline] 

25 # change_list_template = "back-end/django-admin/collections_changelist.html" 

26 

27 

28admin.site.register(Container) 

29 

30 

31@admin.register(Article) 

32class ArticleAdmin(admin.ModelAdmin): 

33 search_fields = ("pid",) 

34 # change_list_template = "back-end/django-admin/remove_all_articles.html" 

35 

36 

37admin.site.register(Provider) 

38 

39admin.site.register(ExtLink) 

40 

41admin.site.register(ContribGroup) 

42 

43admin.site.register(Contrib) 

44 

45admin.site.register(PtfSite)