2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-13 20:47:08 +00:00

[svn] * Adding JS fill in next QM number via ajax.

* Slight models cleanup- get rid of TroggleImageModel class, use mixin instead.
* Collect various troggle shared functions into utils.py
This commit is contained in:
substantialnoninfringinguser
2009-07-04 08:27:49 +01:00
parent c132477f80
commit dd76a1a0be
9 changed files with 154 additions and 112 deletions

View File

@@ -37,7 +37,20 @@ def importSubcaves(cave):
logging.info("Added " + unicode(newSubcave) + " to " + unicode(cave))
except IOError:
logging.info("Subcave import couldn't open "+subcaveFilePath)
def getLinksInSubcaveDescription(subcave):
pattern='<a href=\"(.*?)\">(.*?)</a>'
if subcave.description:
return re.findall(pattern,subcave.description)
else:
return []
def getLinksInAllSubcaves():
bigList=[]
for subcave in Subcave.objects.all():
bigList+=getLinksInSubcaveDescription(subcave)
return bigList
def importAllSubcaves():
for cave in Cave.objects.all():
importSubcaves(cave)