Image
ImageView
¶
Bases: View
View for image records.
This view doesn't have a Data Portal resource that it populates, instead the records that go through this view are embedded within other record types.
Source code in dataimporter/emu/views/image.py
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
__init__(path, store, iiif_url_base)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
the root path that all view related data should be stored under |
required |
db
|
the DataDB object that backs this view |
required | |
iiif_url_base
|
str
|
base URL for the IIIF image URLs created in make_data |
required |
Source code in dataimporter/emu/views/image.py
26 27 28 29 30 31 32 33 | |
is_member(record)
¶
Filters the given record, determining whether it is an image or not.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
SourceRecord
|
the record to filter |
required |
Returns:
| Type | Description |
|---|---|
FilterResult
|
a FilterResult object |
Source code in dataimporter/emu/views/image.py
35 36 37 38 39 40 41 42 43 44 45 | |
is_publishable(record)
¶
Filters the given record, determining whether it matches the publishing rules for images.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
SourceRecord
|
the record to filter |
required |
Returns:
| Type | Description |
|---|---|
FilterResult
|
a FilterResult object |
Source code in dataimporter/emu/views/image.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
transform(record)
¶
Converts the record's raw data to a dict which will then be embedded in other records and presented on the Data Portal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
SourceRecord
|
the record to project |
required |
Returns:
| Type | Description |
|---|---|
dict
|
a dict containing the data for this record that should be displayed on the Data Portal |
Source code in dataimporter/emu/views/image.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |