add_last1-query:
cpk = ca.content_id
rc = rv._content_relationships().filter(content_id=cpk).first()add_last2-query:
| [ | |
| { | |
| "query_id": 3, | |
| "statement_type": "SELECT", | |
| "num_params": 4, | |
| "many": false, | |
| "django_cursor_t": "django.db.backends.postgresql.base.Cursor", | |
| "psycopg_cursor_t": "psycopg.ClientCursor", | |
| "call_site": [ | |
| "/src/pulp_deb/pulp_deb/tests/unit/test_copy.py:252 in test_scales_sublinearly_across_content_relationships", |
| import asyncio | |
| import os | |
| import select | |
| import time | |
| import socket | |
| from multiprocessing import Process | |
| ITERATIONS = 10 | |
| import re | |
| from pathlib import Path | |
| def read_files(): | |
| return list(Path("staging_docs/sections/blog/posts/").glob("*.md")) | |
| def fix_blog_posts(): | |
| """ | |
| Problems: | |
| * add heading zero to filenames missing it: yyyy-mm-d | |
| * delete "- date:" lines from frontmatter |
| import typing as t | |
| from dataclasses import dataclass, is_dataclass | |
| # not strictly necessary, but makes sense | |
| T = t.TypeVar("T") # https://mypy.readthedocs.io/en/stable/generics.html | |
| class ValidationError(ValueError): | |
| ... |
| #/bin/bash | |
| # https://gist.github.com/zaiste/77a946bbba73f5c4d33f3106a494e6cd | |
| FILENAME="CHANGES" | |
| pandoc "$FILENAME.rst" -f rst -t markdown -o "$FILENAME.md" | |
| # quotes: \"hupper\" -> "hupper" | |
| sed -i "$FILENAME.md" -e 's/\\\("[a-zA-Z_-]*\)\\"/\1"/g' | |
| # github: `4976`{.interpreted-text role="github"} -> [4976](https://github.../issues/4976) |
| #!/bin/bash | |
| # 1. create structure | |
| mkdir -p \ | |
| staging_docs/{admin,user,dev}/{guides,tutorials,learn} \ | |
| staging_docs/reference | |
| cp -r docs tmp_docs | |
| # 2. convert to rst->markdown (optional) | |
| pip install rst-to-myst[sphinx] | |
| find tmp_docs -name '*.rst' -exec rst2myst convert --replace-files {} ';' |
| from __future__ import annotations | |
| from io import TextIOWrapper | |
| from typing import Callable, TypeAlias | |
| FileParser: TypeAlias = Callable[[TextIOWrapper], dict[str, str]] | |
| def load_data(obj, file_parser: FileParser, extensions: tuple[str, ...], **kwargs): | |
| """ |
| from dynaconf import Dynaconf | |
| settings = Dynaconf( | |
| envvar_prefix="DYNACONF", | |
| settings_file="settings.toml", | |
| environments=True, | |
| ) |