From b816463d1d81faeba373349c2728d435515a0a45 Mon Sep 17 00:00:00 2001 From: substantialnoninfringinguser Date: Sat, 4 Jul 2009 08:27:49 +0100 Subject: [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 --- parsers/subcaves.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'parsers/subcaves.py') diff --git a/parsers/subcaves.py b/parsers/subcaves.py index c3acc4d..bdd64a1 100644 --- a/parsers/subcaves.py +++ b/parsers/subcaves.py @@ -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='(.*?)' + 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) -- cgit v1.2.3