uchicago-library / library_website

The University of Chicago Library Website
5 stars 5 forks source link

Update printing webpage to be driven by Wagtail #707

Closed bbusenius closed 1 year ago

bbusenius commented 1 year ago

Issue

The printing.uchicago.edu webpage is a standalone static webpage that was designed to look like it is owned by the University, however, it is maintained by us. Since it is a standalone page, it must be updated manually by us. This page should be editable in Wagtail so that Librarians can maintain it. This can be achieved using the Wagtail restful API.

Related materials

Related code

An example of how to add fields to the rest API.

    from wagtail.api import APIField

    api_fields = [
        APIField('cnetid'),
        APIField(
            'employee_type',
            serializer=serializers.CharField(source='get_employee_type')
        ),
        APIField('position_title'),
        APIField('position_eliminated'),
        APIField('supervises_students'),
        APIField(
            'library_units',
            serializer=serializers.ListField(source='get_serialized_units')
        ),
    ]

Additional information: