def addToDefaultArgs( CSVname, modelName ): #This has to do with the non-destructive import. These arguments will be passed as the "default" dictionary in a get_or_create if line[CSVname]: defaultArgs[modelName] = html_to_wiki(line[CSVname])
def addToArgs(CSVname, modelName): if line[CSVname]: args[modelName] = html_to_wiki(line[CSVname])
def parseDescriptionsOnCaveObjects(): for cave in models.Cave.objects.all(): cave.underground_description = html_to_wiki( unicode(cave.underground_description)) cave.save()
def addToArgsViaDict(CSVname, modelName, dictionary): if line[CSVname]: args[modelName] = dictionary[html_to_wiki(line[CSVname])]
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()