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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user