Skip to content

Interfaces

IGalleryImage

Bases: Interface

IGallery plugin for retrieving images from records.

Source code in ckanext/gallery/plugins/interfaces.py
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
class IGalleryImage(interfaces.Interface):
    """
    IGallery plugin for retrieving images from records.
    """

    def image_info(self):
        """
        Returns information about this plugin.

        :returns:
        """

    def get_images(self, field_value, record, data_dict):
        """
        Retrieve images from a record and present them as a list of dicts. Valid output
        fields for each image:

            - href (main/preview URL; required)
            - thumbnail (URL for a smaller version of the image)
            - download (URL for the downloadable version of the image)
            - link (e.g. record URL, displayed in popup viewer)
            - copyright (licence information; HTML)
            - description (displayed under the image thumbnail; HTML)
            - title (title in the popup viewer and image alt)
            - record_id

        :returns: list of dicts
        """

get_images(field_value, record, data_dict)

Retrieve images from a record and present them as a list of dicts. Valid output fields for each image:

- href (main/preview URL; required)
- thumbnail (URL for a smaller version of the image)
- download (URL for the downloadable version of the image)
- link (e.g. record URL, displayed in popup viewer)
- copyright (licence information; HTML)
- description (displayed under the image thumbnail; HTML)
- title (title in the popup viewer and image alt)
- record_id

Returns:

Type Description

list of dicts

Source code in ckanext/gallery/plugins/interfaces.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def get_images(self, field_value, record, data_dict):
    """
    Retrieve images from a record and present them as a list of dicts. Valid output
    fields for each image:

        - href (main/preview URL; required)
        - thumbnail (URL for a smaller version of the image)
        - download (URL for the downloadable version of the image)
        - link (e.g. record URL, displayed in popup viewer)
        - copyright (licence information; HTML)
        - description (displayed under the image thumbnail; HTML)
        - title (title in the popup viewer and image alt)
        - record_id

    :returns: list of dicts
    """

image_info()

Returns information about this plugin.

Returns:

Type Description
Source code in ckanext/gallery/plugins/interfaces.py
15
16
17
18
19
20
def image_info(self):
    """
    Returns information about this plugin.

    :returns:
    """