2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 12:37:10 +00:00

[svn] * Make descriptions parser also replace links to descriptions from Cave models' underground_descriptions with wikilinks for valid (existing) links

* Make entrances searchable in admin by cave kataster number
This commit is contained in:
substantialnoninfringinguser
2009-07-16 05:37:33 +01:00
parent e0613a3888
commit 5b3a951be3
5 changed files with 35 additions and 7 deletions

View File

@@ -22,6 +22,7 @@ pages = [(["smkridge", "204", "ariston-rigging.html"], "ariston-rigging"),
def getDescriptions():
"""Creates objects in the database for each item in the list 'pages' . """
for filelocation, name in pages:
f = open(os.path.join(settings.EXPOWEB, *filelocation), "r")
html = f.read()
@@ -32,7 +33,13 @@ def getDescriptions():
cd.save()
def parseDescriptions():
"""Turns the HTML in each cave description into wikicode"""
for cd in models.CaveDescription.objects.all():
cd.description = html_to_wiki(cd.description)
cd.save()
cd.save()
def parseDescriptionsInCaveObjects():
for cave in models.Cave.objects.all():
cave.underground_description=html_to_wiki(unicode(cave.underground_description))
cave.save()