Skip to content

Commit

Permalink
closes #162
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Feb 29, 2024
1 parent d02181b commit d6f366e
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions issue__162_tagebuchurifix.ipynb
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit d6f366e

Please sign in to comment.