diff --git a/issue__162_tagebuchurifix.ipynb b/issue__162_tagebuchurifix.ipynb new file mode 100644 index 0000000..0ee9f11 --- /dev/null +++ b/issue__162_tagebuchurifix.ipynb @@ -0,0 +1,89 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "bbbbf1e8", + "metadata": {}, + "outputs": [], + "source": [ + "from tqdm import tqdm" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1233b691", + "metadata": {}, + "outputs": [], + "source": [ + "uris = Uri.objects.filter(uri__icontains=\"schnitzler-tagebuch.acdh.oeaw.ac.at/entity/\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "17196a40", + "metadata": {}, + "outputs": [], + "source": [ + "uris.count()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0e9d83d5", + "metadata": {}, + "outputs": [], + "source": [ + "for x in tqdm(uris, total=uris.count()):\n", + " new_uri = f'{x.uri.replace(\"/entity\", \"\")}.html'\n", + " x.uri = new_uri\n", + " try:\n", + " x.save()\n", + " except Exception as e:\n", + " print(x, e)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6b37ca48", + "metadata": {}, + "outputs": [], + "source": [ + "Uri.objects.filter(uri__icontains=\"schnitzler-tagebuch.acdh.oeaw.ac.at/entity/\").count()" + ] + }, + { + "cell_type": "markdown", + "id": "e19d4223", + "metadata": {}, + "source": [ + "### run on production 2024-02-29" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Django Shell-Plus", + "language": "python", + "name": "django_extensions" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}