-
-
Save ashwch/1fc98f3f76860b95936bf278ba38dbba to your computer and use it in GitHub Desktop.
pg_history_demo_1.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pghistory | |
| with pghistory.context(url="/foo/bar", user="bugs-bunny") as pg: | |
| print(f"Level 1-1: {pg.metadata}") | |
| with pghistory.context(foo="bar"): | |
| print(f"Level 2-1: {pg.metadata}") | |
| with pghistory.context(spam="eggs"): | |
| print(f"Level 3-1: {pg.metadata}") | |
| with pghistory.context(hannah="montana"): | |
| print(f"Level 3-2: {pg.metadata}") | |
| with pghistory.context(timon="pumba"): | |
| print(f"Level 4-1: {pg.metadata}") | |
| print(f"Level 1-2: {pg.metadata}") | |
| with pghistory.context(monty="python"): | |
| print(f"Level 2-2: {pg.metadata}") | |
| with pghistory.context(guido="bdfl") as pg_2: | |
| print(f"Level 1-4: {pg_2.metadata}") | |
| print(f"Level 1-5: {pg.metadata}") | |
| print(f"Level 1-6: {pg_2.metadata}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment