summaryrefslogtreecommitdiff
path: root/postgresqleu/confreg/contextutil.py
AgeCommit message (Collapse)Author
2024-04-15Add support for token-downloads of sponsor level metadataMagnus Hagander
In passing, this adds support for YaML format downloads of all token based data. The token data will generate json or yaml with information about all sponsorship levels and benefits created in the system. The idea being this can be pulled into a context file and thereby guaranteed to be the same in the static and dynamic parts of the site. We'know from experience these can easily get slightly out of sync.
2023-08-25Support YAML as well as JSON for context filesMagnus Hagander
Previously only json as supported for the template integration for context.json and context.override.d. This adds support for yaml as well both for a context.yaml file, and for putting yaml files in context.override.d. If both a json and yaml exists with the same name (in the root or in the override), then the json will be loaded first and then the yaml merged on top of it. YAML has a few features that are really useful for the context file such as comments and easier on the eyes multi-line string handling, but fundamentally the handling is exactly the same. If the `yaml` module is not importable, then yaml files are simply ignored.
2023-08-21Move context loading into contextutil.pyMagnus Hagander
No functionality change at this point, but this makes the code cleaner and will make some future additions easier to make.
2020-02-09Replace context.override.json with a directory context.override.dMagnus Hagander
Instead of loading a single override file in context.override.json, load every file called *.json in the directory context.override.d. This is useful for example for the case of downloading the schedule data into a file and then using it for testing, instead of having to "stitch" it into place in an existing file. NOTE! For test cases using context.override.json today, just create a context.override.d and move the existing override file into this directory, and things should work like before again. NOTE! As context.override.json is not supposed to be committed to the git repository, this should not affect any production installs, but will affect most local test setups.