Copyright (C) 2017 The Open Library Foundation
This software is distributed under the terms of the Apache License, Version 2.0. See the file "LICENSE" for more information.
This contains init_mod_waitlist.py which can be used to populate mod-waitlist datatables with sample waitlist reserves data.
In order for init_mod_waitlist.py to work properly, the datatables for mod-waitlist must be generated for the diku tenant. The datatables can be autogenerated by enabling mod-waitlist for the diku tenant through the Okapi gateway.
Datatables for mod-waitlist are autogenerated when mod-waitlist is enabled for a given user (e.g. diku) through the following process:
- An HTTP POST request to enable
mod-waitlistfordikuis sent to the Okapi gateway. - The Okapi gateway calls the
/_/tenantendpoint ofmod-waitlist. - The
/_/tenantendpoint uses a template to autogenerate the postgres, tenant-specific schema formod-waitlist.
Ingesting mod-waitlist sample data involves:
- Running and enabling
mod-waitlistthrough Okapi, in order to trigger the creation of thediku_mod_waitlistschema andcourses/items/instructorstables. - Running
init_mod_waitlist.pywhich will automatically add uuidv4 ids to the json objects and then insert them into thejsonbcolumn of their corresponding postgres datatables.