-
Notifications
You must be signed in to change notification settings - Fork 27
/
reports.py
55 lines (51 loc) · 1.3 KB
/
reports.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from core.common.constants import HEAD
from core.reports.models import AbstractReport
from core.sources.models import Source
class SourceReport(AbstractReport):
queryset = Source.objects.filter(version=HEAD)
name = 'Sources'
select_related = ['created_by', 'organization', 'user']
verbose_fields = [
'mnemonic',
'name',
'created_by.username',
'created_at',
'parent_resource_type',
'parent_resource',
'canonical_url',
'custom_validation_schema'
]
VERBOSE_HEADERS = [
"ID",
"Name",
"Created By",
"Created At",
"Owner Type",
"Owner",
"Canonical URL",
"Validation Schema"
]
class SourceVersionReport(AbstractReport):
queryset = Source.objects.exclude(version=HEAD)
name = 'Source Versions'
select_related = ['created_by', 'organization', 'user']
verbose_fields = [
'version',
'mnemonic',
'name',
'created_by.username',
'created_at',
'parent_resource_type',
'parent_resource',
'custom_validation_schema'
]
VERBOSE_HEADERS = [
"Version",
"ID",
"Name",
"Created By",
"Created At",
"Owner Type",
"Owner",
"Validation Schema"
]